disable forecast for now

This commit is contained in:
Johannes
2025-05-28 21:56:14 +02:00
committed by GitHub
parent 04ac10b453
commit 397932a6bc

View File

@@ -383,18 +383,18 @@ class LuiPagesGen(object):
elif entityType == "weather":
entityTypePanel = "text"
unit = get_attr_safe(entity, "temperature_unit", "")
if type(item.stype) == int and len(entity.attributes.forecast) >= item.stype:
fdate = dp.parse(entity.attributes.forecast[item.stype]['datetime'])
global babel_spec
if babel_spec is not None:
dateformat = "E" if item.nameOverride is None else item.nameOverride
name = babel.dates.format_datetime(fdate.astimezone(), dateformat, locale=self._locale)
else:
dateformat = "%a" if item.nameOverride is None else item.nameOverride
name = fdate.astimezone().strftime(dateformat)
icon_id = get_icon_ha(entityId, stateOverwrite=entity.attributes.forecast[item.stype]['condition'])
value = f'{entity.attributes.forecast[item.stype].get("temperature", "")}{unit}'
color = self.get_entity_color(entity, ha_type=entityType, stateOverwrite=entity.attributes.forecast[item.stype]['condition'], overwrite=colorOverride)
#if type(item.stype) == int and len(entity.attributes.forecast) >= item.stype:
# fdate = dp.parse(entity.attributes.forecast[item.stype]['datetime'])
# global babel_spec
# if babel_spec is not None:
# dateformat = "E" if item.nameOverride is None else item.nameOverride
# name = babel.dates.format_datetime(fdate.astimezone(), dateformat, locale=self._locale)
# else:
# dateformat = "%a" if item.nameOverride is None else item.nameOverride
# name = fdate.astimezone().strftime(dateformat)
# icon_id = get_icon_ha(entityId, stateOverwrite=entity.attributes.forecast[item.stype]['condition'])
# value = f'{entity.attributes.forecast[item.stype].get("temperature", "")}{unit}'
# color = self.get_entity_color(entity, ha_type=entityType, stateOverwrite=entity.attributes.forecast[item.stype]['condition'], overwrite=colorOverride)
else:
value = f'{get_attr_safe(entity, "temperature", "")}{unit}'
else: