This commit is contained in:
Johannes
2025-07-31 20:37:31 +02:00
committed by GitHub
parent d53afb0b20
commit 65be5ffeb0

View File

@@ -387,15 +387,21 @@ class LuiPagesGen(object):
elif entityType == "weather":
entityTypePanel = "text"
unit = get_attr_safe(entity, "temperature_unit", "")
rt = None
if type(item.stype) == str:
spintstr = item.stype.split(":")
rt = spintstr[0]
item.stype = int(spintstr[1])
if type(item.stype) == int:
bits = get_attr_safe(entity, "supported_features", 0b0)
rt = "daily"
if bits & 0b001: #FORECAST_DAILY
if not rt:
rt = "daily"
elif bits & 0b010: #FORECAST_HOURLY
rt = "hourly"
elif bits & 0b100: #FORECAST_TWICE_DAILY
rt = "twice_daily"
if bits & 0b001: #FORECAST_DAILY
rt = "daily"
elif bits & 0b010: #FORECAST_HOURLY
rt = "hourly"
elif bits & 0b100: #FORECAST_TWICE_DAILY
rt = "twice_daily"
results = apis.ha_api.call_service(
"weather/get_forecasts", target={"entity_id": entityId}, service_data={"type": rt}