mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-24 00:14:26 +01:00
add vac #393
This commit is contained in:
@@ -294,7 +294,11 @@ class LuiController(object):
|
|||||||
self._ha_api.get_entity(entity_id).call_service("press")
|
self._ha_api.get_entity(entity_id).call_service("press")
|
||||||
elif entity_id.startswith('input_select'):
|
elif entity_id.startswith('input_select'):
|
||||||
self._ha_api.get_entity(entity_id).call_service("select_next")
|
self._ha_api.get_entity(entity_id).call_service("select_next")
|
||||||
|
elif entity_id.startswith('vacuum'):
|
||||||
|
if self._ha_api.get_entity(entity_id).state == "docked":
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("start")
|
||||||
|
else:
|
||||||
|
self._ha_api.get_entity(entity_id).call_service("return_to_base")
|
||||||
|
|
||||||
# for media page
|
# for media page
|
||||||
if button_type == "media-next":
|
if button_type == "media-next":
|
||||||
|
|||||||
@@ -300,6 +300,13 @@ class LuiPagesGen(object):
|
|||||||
icon_id = get_icon_id_ha("button", state=entity.state, overwrite=icon)
|
icon_id = get_icon_id_ha("button", state=entity.state, overwrite=icon)
|
||||||
text = entity.state
|
text = entity.state
|
||||||
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
|
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
|
||||||
|
if entityType == "vacuum":
|
||||||
|
icon_id = get_icon_id_ha("robot-vacuum", state=entity.state, overwrite=icon)
|
||||||
|
if entity.state == "docked":
|
||||||
|
text = "Start"
|
||||||
|
else:
|
||||||
|
text = "Return"
|
||||||
|
return f"~button~{entityId}~{icon_id}~17299~{name}~{text}"
|
||||||
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~unsupported~"
|
return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~unsupported~"
|
||||||
|
|
||||||
def generate_entities_page(self, navigation, heading, items, cardType):
|
def generate_entities_page(self, navigation, heading, items, cardType):
|
||||||
|
|||||||
Reference in New Issue
Block a user