This commit is contained in:
Johannes
2022-10-01 10:00:51 +02:00
committed by GitHub
parent 7dc7b9a456
commit 0950a7b694
2 changed files with 8 additions and 4 deletions

View File

@@ -379,7 +379,7 @@ class LuiPagesGen(object):
command += self.generate_entities_item(item, cardType, tempUnit)
self._send_mqtt_msg(command)
def generate_thermo_page(self, navigation, title, entity, temp_unit):
def generate_thermo_page(self, navigation, title, entity, temp_unit, overwrite_supported_modes):
item = entity.entityId
if(temp_unit == "celsius"):
@@ -419,7 +419,8 @@ class LuiPagesGen(object):
icon_res = ""
hvac_modes = get_attr_safe(entity, "hvac_modes", [])
if overwrite_supported_modes is not None:
hvac_modes = overwrite_supported_modes
for mode in hvac_modes:
icon_id = get_icon("climate", state=mode)
color_on = 64512
@@ -613,7 +614,9 @@ class LuiPagesGen(object):
self.generate_entities_page(navigation, card.title, card.entities, card.cardType, temp_unit)
return
if card.cardType == "cardThermo":
self.generate_thermo_page(navigation, card.title, card.entity, temp_unit)
temp_unit = card.raw_config.get("temperatureUnit", "celsius")
overwrite_supported_modes = card.raw_config.get("supportedModes")
self.generate_thermo_page(navigation, card.title, card.entity, temp_unit, overwrite_supported_modes)
return
if card.cardType == "cardMedia":
mediaBtn = card.raw_config.get("mediaControl", "")

View File

@@ -23,4 +23,5 @@ key | optional | type | default | description
`entities` | False | complex | `None` | contains a list of entities of this card
`title` | True | string | `None` | Title of the Page
`temperatureUnit` | True | string | `celsius` | set this to fahrenheit to change the temperatureUnit on the page
`key` | True | string | `None` | Used by navigate items in combination with the type (cardEntities_key)
`key` | True | string | `None` | Used by navigate items in combination with the type (cardEntities_key)
`supportedModes` | True | list | `None` | Supply list of heat actions if you want to limit the actions on the card. Example `['heat', 'off']`