mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-19 22:24:15 +01:00
implements #1351
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user