mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-24 02:02:15 +01:00
Enhance button press logging with resolved entity ID
Log the resolved entity ID along with the button press event details.
This commit is contained in:
@@ -206,11 +206,15 @@ class LuiController(object):
|
|||||||
self._pages_gen.generate_timer_detail_page(entity_id, True)
|
self._pages_gen.generate_timer_detail_page(entity_id, True)
|
||||||
|
|
||||||
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} ")
|
||||||
|
entity_id_new = entity_id
|
||||||
if entity_id.startswith('uuid'):
|
if entity_id.startswith('uuid'):
|
||||||
entity_config = self._config._config_entites_table.get(entity_id)
|
entity_config = self._config._config_entites_table.get(entity_id)
|
||||||
if entity_config is not None:
|
if entity_config is not None:
|
||||||
entity_id = entity_config.entityId
|
entity_id_new = entity_config.entityId
|
||||||
|
apis.ha_api.log(f"Button Press Event; entity_id: {entity_id}; entity_id_resolved: {entity_id_new}; button_type: {button_type}; value: {value} ")
|
||||||
|
entity_id = entity_id_new
|
||||||
|
|
||||||
# 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
|
||||||
|
|||||||
Reference in New Issue
Block a user