Fix for empty detail page after change on previous page (#662)

* Update mqtt.py

Allow force sending duplicate messages

* Update pages.py

Allow forcing sending MQTT message when the detail page is initially generated

* Update controller.py

Set is_open_detail to True when generate_xx_detail_page is called from detail_open
This commit is contained in:
kayvenm
2023-01-03 08:14:06 -05:00
committed by GitHub
parent 801c17ca47
commit 0cd3045340
3 changed files with 24 additions and 22 deletions

View File

@@ -180,17 +180,18 @@ class LuiController(object):
def detail_open(self, detail_type, entity_id):
if detail_type == "popupShutter":
self._pages_gen.generate_shutter_detail_page(entity_id)
self._pages_gen.generate_shutter_detail_page(entity_id, True)
if detail_type == "popupLight":
self._pages_gen.generate_light_detail_page(entity_id)
self._pages_gen.generate_light_detail_page(entity_id, True)
if detail_type == "popupFan":
self._pages_gen.generate_fan_detail_page(entity_id)
self._pages_gen.generate_fan_detail_page(entity_id, True)
if detail_type == "popupThermo":
self._pages_gen.generate_thermo_detail_page(entity_id)
self._pages_gen.generate_thermo_detail_page(entity_id, True)
if detail_type == "popupInSel":
self._pages_gen.generate_input_select_detail_page(entity_id)
self._pages_gen.generate_input_select_detail_page(entity_id, True)
if detail_type == "popupTimer":
self._pages_gen.generate_timer_detail_page(entity_id)
self._pages_gen.generate_timer_detail_page(entity_id, True)
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} ")
# internal buttons
@@ -425,4 +426,4 @@ class LuiController(object):
if button_type == "timer-pause":
apis.ha_api.get_entity(entity_id).call_service("pause")
if button_type == "timer-finish":
apis.ha_api.get_entity(entity_id).call_service("finish")
apis.ha_api.get_entity(entity_id).call_service("finish")