mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-21 15:04:24 +01:00
@@ -379,7 +379,7 @@ class LuiPagesGen(object):
|
|||||||
command += self.generate_entities_item(item, cardType, tempUnit)
|
command += self.generate_entities_item(item, cardType, tempUnit)
|
||||||
self._send_mqtt_msg(command)
|
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
|
item = entity.entityId
|
||||||
|
|
||||||
if(temp_unit == "celsius"):
|
if(temp_unit == "celsius"):
|
||||||
@@ -419,7 +419,8 @@ class LuiPagesGen(object):
|
|||||||
icon_res = ""
|
icon_res = ""
|
||||||
|
|
||||||
hvac_modes = get_attr_safe(entity, "hvac_modes", [])
|
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:
|
for mode in hvac_modes:
|
||||||
icon_id = get_icon("climate", state=mode)
|
icon_id = get_icon("climate", state=mode)
|
||||||
color_on = 64512
|
color_on = 64512
|
||||||
@@ -613,7 +614,9 @@ class LuiPagesGen(object):
|
|||||||
self.generate_entities_page(navigation, card.title, card.entities, card.cardType, temp_unit)
|
self.generate_entities_page(navigation, card.title, card.entities, card.cardType, temp_unit)
|
||||||
return
|
return
|
||||||
if card.cardType == "cardThermo":
|
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
|
return
|
||||||
if card.cardType == "cardMedia":
|
if card.cardType == "cardMedia":
|
||||||
mediaBtn = card.raw_config.get("mediaControl", "")
|
mediaBtn = card.raw_config.get("mediaControl", "")
|
||||||
|
|||||||
@@ -23,4 +23,5 @@ key | optional | type | default | description
|
|||||||
`entities` | False | complex | `None` | contains a list of entities of this card
|
`entities` | False | complex | `None` | contains a list of entities of this card
|
||||||
`title` | True | string | `None` | Title of the Page
|
`title` | True | string | `None` | Title of the Page
|
||||||
`temperatureUnit` | True | string | `celsius` | set this to fahrenheit to change the temperatureUnit on 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']`
|
||||||
|
|||||||
Reference in New Issue
Block a user