mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-01-03 21:34:20 +01:00
Current Card access (#1184)
* Turn app into AD Base app * Added the ability to keep the messages being sent quiet * fix little conflict * Allow other apps to have access to current app * Access other cards from apps
This commit is contained in:
@@ -458,3 +458,9 @@ class LuiController(object):
|
||||
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")
|
||||
|
||||
@property
|
||||
def current_card(self) -> str:
|
||||
"""Used to get the current card"""
|
||||
|
||||
return self._current_card
|
||||
|
||||
@@ -28,7 +28,7 @@ class NsPanelLovelaceUIManager(ad.ADBase):
|
||||
|
||||
mqttsend = LuiMqttSender(apis.ha_api, use_api, topic_send, api_panel_name, quiet)
|
||||
|
||||
controller = LuiController(cfg, mqttsend.send_mqtt_msg)
|
||||
self._controller = LuiController(cfg, mqttsend.send_mqtt_msg)
|
||||
|
||||
desired_tasmota_driver_version = 8
|
||||
desired_display_firmware_version = 53
|
||||
@@ -49,6 +49,12 @@ class NsPanelLovelaceUIManager(ad.ADBase):
|
||||
# Request Tasmota Driver Version
|
||||
updater.request_berry_driver_version()
|
||||
|
||||
LuiMqttListener(use_api, topic_recv, api_panel_name, api_device_id, controller, updater)
|
||||
LuiMqttListener(use_api, topic_recv, api_panel_name, api_device_id, self._controller, updater)
|
||||
|
||||
self.adapi.log(f'Started ({version})')
|
||||
|
||||
@property
|
||||
def current_card(self) -> str:
|
||||
"""Used to get the panel's current card"""
|
||||
|
||||
return self._controller.current_card.key
|
||||
|
||||
Reference in New Issue
Block a user