Update controller.py

This commit is contained in:
Johannes
2023-02-12 21:29:54 +01:00
committed by GitHub
parent b08df614c9
commit 9a27be66c9

View File

@@ -194,6 +194,10 @@ class LuiController(object):
def button_press(self, entity_id, button_type, value): def button_press(self, entity_id, button_type, value):
apis.ha_api.log(f"Button Press Event; entity_id: {entity_id}; button_type: {button_type}; value: {value} ") apis.ha_api.log(f"Button Press Event; entity_id: {entity_id}; button_type: {button_type}; value: {value} ")
if entity_id.startswith('uuid'):
entity_config = self._config._config_entites_table.get(entity_id)
if entity_config is not None:
entity_id = entity_config.entityId
# internal buttons # internal buttons
if entity_id == "screensaver" and button_type == "bExit": if entity_id == "screensaver" and button_type == "bExit":
# get default card if there is one # get default card if there is one
@@ -267,10 +271,6 @@ class LuiController(object):
if button_type == "button": if button_type == "button":
if entity_id.startswith('uuid'):
entity_config = self._config._config_entites_table.get(entity_id)
entity_id = entity_config.entityId
if entity_id.startswith('navigate'): if entity_id.startswith('navigate'):
# internal navigation for next/prev # internal navigation for next/prev
if entity_id.startswith('navigate.uuid'): if entity_id.startswith('navigate.uuid'):
@@ -418,6 +418,9 @@ class LuiController(object):
entity.call_service("select_option", option=option) entity.call_service("select_option", option=option)
if button_type == "mode-light": if button_type == "mode-light":
if entity_id.startswith('uuid'):
entity_config = self._config._config_entites_table.get(entity_id)
entity_id = entity_config.entityId
entity = apis.ha_api.get_entity(entity_id) entity = apis.ha_api.get_entity(entity_id)
options_list = entity_config.entity_input_config.get("effectList") options_list = entity_config.entity_input_config.get("effectList")
if options_list is not None: if options_list is not None: