Fix first button not responding to short press (#603)

This commit is contained in:
Edward Firmo
2023-04-05 02:04:12 +02:00
committed by GitHub
parent f871ef84e9
commit 2a5f3124d5

View File

@@ -5073,7 +5073,7 @@ action:
last_click_state: "{{ states(last_click) | default('unavailable') if last_click is string else 'unavailable' }}"
last_click_coordinates: "{{ last_click_state.replace('releasebuttonpage', '').split('button') if last_click_state not in ['unavailable', 'unknown', None] else [-1, -1] }}"
last_click_entity_index: "{{ (last_click_coordinates[0] | int(-99) -1)*8 + last_click_coordinates[1] | int(-99) - 1 }}"
- condition: "{{ last_click_entity_index > 0 }}"
- condition: "{{ last_click_entity_index >= 0 }}"
- variables:
last_click_button: "{{ button_pages_buttons[last_click_entity_index] | default([]) }}"
entity_short: "{{ last_click_button.entity | default('unavailable') if last_click_button and last_click_button.entity is defined }}"