mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-24 00:14:26 +01:00
@@ -246,6 +246,13 @@ nspanel-1:
|
||||
- button.example_button
|
||||
- input_button.example_input_button
|
||||
- light.light_example
|
||||
- delete # To make sure we don't keep buttons from previous page (read this as 'empty')
|
||||
- type: cardEntities
|
||||
heading: Example Page 3
|
||||
items:
|
||||
- scene.some_scene
|
||||
- scene.moodlights
|
||||
- delete
|
||||
- delete
|
||||
- type: cardThermo
|
||||
heading: Exmaple Thermostat
|
||||
|
||||
@@ -179,6 +179,9 @@ class NsPanelLovelanceUI:
|
||||
self.api.get_entity(entity_id).call_service("close_cover")
|
||||
|
||||
if(btype == "button"):
|
||||
if(entity_id.startswith('scene')):
|
||||
self.api.get_entity(entity_id).call_service("turn_on")
|
||||
else:
|
||||
self.api.get_entity(entity_id).call_service("press")
|
||||
|
||||
if(btype == "media-next"):
|
||||
@@ -300,8 +303,11 @@ class NsPanelLovelanceUI:
|
||||
value = entity.state + " " + entity.attributes.unit_of_measurement
|
||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, "text", item, icon_id, name, value)
|
||||
|
||||
if item_type == "button":
|
||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, item_type, item, 3, name, "PRESS")
|
||||
if item_type == "button" or item_type == "input_button":
|
||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, "button", item, 3, name, "PRESS")
|
||||
|
||||
if item_type == "scene":
|
||||
return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, "button", item, 5, name, "ACTIVATE")
|
||||
|
||||
def generate_thermo_page(self, item):
|
||||
entity = self.api.get_entity(item)
|
||||
|
||||
Reference in New Issue
Block a user