mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-24 08:24:25 +01:00
Add Entity Type "Valve" (#1347)
* Update pages.py * Update controller.py * Update pages.py * Update pages.py
This commit is contained in:
@@ -334,6 +334,11 @@ class LuiController(object):
|
||||
apis.ha_api.get_entity(entity_id).call_service("return_to_base")
|
||||
elif entity_id.startswith('service'):
|
||||
apis.ha_api.call_service(entity_id.replace('service.', '', 1).replace('.','/', 1), **entity_config.data)
|
||||
elif entity_id.startswith('valve'):
|
||||
if apis.ha_api.get_entity(entity_id).state == "open":
|
||||
apis.ha_api.get_entity(entity_id).call_service("close_valve")
|
||||
else:
|
||||
apis.ha_api.get_entity(entity_id).call_service("open_valve")
|
||||
|
||||
# for media page
|
||||
if button_type == "media-next":
|
||||
|
||||
@@ -396,6 +396,13 @@ class LuiPagesGen(object):
|
||||
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}'
|
||||
elif entityType == "valve":
|
||||
entityTypePanel = "valve"
|
||||
value = get_translation(self._locale, f"backend.component.binary_sensor.state.door.{entity.state}")
|
||||
if entity.state == "open":
|
||||
icon_id = get_icon_id("valve-open")
|
||||
else:
|
||||
icon_id = get_icon_id("valve-closed")
|
||||
else:
|
||||
name = "unsupported"
|
||||
# Overwrite for value
|
||||
|
||||
Reference in New Issue
Block a user