diff --git a/apps/nspanel-lovelace-ui/luibackend/controller.py b/apps/nspanel-lovelace-ui/luibackend/controller.py index 9e678260..8f6f75bf 100644 --- a/apps/nspanel-lovelace-ui/luibackend/controller.py +++ b/apps/nspanel-lovelace-ui/luibackend/controller.py @@ -241,9 +241,13 @@ class LuiController(object): if button_type == "button": if entity_id.startswith('navigate'): # internal for navigation to nested pages - self._previous_cards.append(self._current_card) - self._current_card = self._config.searchCard(entity_id) - self._pages_gen.render_card(self._current_card) + dstCard = self._config.searchCard(entity_id) + if dstCard is not None: + self._previous_cards.append(self._current_card) + self._current_card = dstCard + self._pages_gen.render_card(self._current_card) + else: + self._ha_api.log(f"No page with key {entity_id} found") elif entity_id.startswith('scene'): self._ha_api.get_entity(entity_id).call_service("turn_on") elif entity_id.startswith('script'): diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 968ffc71..b4b7d218 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -139,7 +139,7 @@ class LuiPagesGen(object): entity = self._ha_api.get_entity(statusIcon.get("entity")) entityType = statusIcon.get("entity").split(".")[0] icon = get_icon_id_ha(entityType, state=entity.state, device_class=entity.attributes.get("device_class", ""), overwrite=icon) - color = self.get_entity_color(entity) + color = self.get_entity_color(entity, overwrite=statusIcon.get("color", None)) status_res += f"~{icon}~{color}" self._send_mqtt_msg(f"weatherUpdate~{icon_cur}~{text_cur}{weather_res}{altLayout}{status_res}") @@ -172,7 +172,9 @@ class LuiPagesGen(object): status_entity = self._ha_api.get_entity(item.status) icon_color = self.get_entity_color(status_entity) if item.status.startswith("sensor") and cardType == "cardGrid": - icon_id = status_entity.state + icon_id = status_entity.state[:3] + if icon_id[-1] == ".": + icon_id = icon_id[:-1] else: icon_color = 17299 return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}" diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index 057b97d7..6af1f12c 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -1,6 +1,6 @@ /*----------------------------------------------------------------------- TypeScript zur Steuerung des SONOFF NSPanel mit dem ioBroker -- abgestimmt auf TFT 36 / v2.9.0 / BerryDriver 4 / Tasmota 11.1.0 +- abgestimmt auf TFT 37 / v3.0.0 / BerryDriver 4 / Tasmota 11.1.0 joBr99 Projekt: https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker NsPanelTs.ts (dieses TypeScript in ioBroker) Stable: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/NsPanelTs.ts icon_mapping.ts: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/icon_mapping.ts (TypeScript muss in global liegen) @@ -82,7 +82,7 @@ Erforderliche Adapter: Upgrades in Konsole: Tasmota BerryDriver : Backlog UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; Restart 1 - TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v2.9.0.tft + TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v3.0.0.tft --------------------------------------------------------------------------------------- */ var Icons = new IconsSelector(); @@ -328,7 +328,7 @@ var WLAN: PageQR = "heading": "Gäste WLAN", "useColor": true, "subPage": true, - "parent": WLAN, + "parent": Subpages_1, "items": [{ id: "alias.0.NSPanel_1.Guest_Wifi" }] }; @@ -550,7 +550,7 @@ check_updates(); //------------------Begin Update Functions function check_updates() { - const desired_display_firmware_version = 36; + const desired_display_firmware_version = 37; const berry_driver_version = 4; if (Debug) console.log("Check-Updates"); @@ -784,7 +784,7 @@ function update_berry_driver_version() { } function update_tft_firmware() { - const tft_version : string = "v2.9.0"; + const tft_version : string = "v3.0.0"; var desired_display_firmware_url = "http://nspanel.pky.eu/lovelace-ui/github/nspanel-" + tft_version + ".tft" require("request")((['http://',get_current_tasmota_ip_address(),'/cm?cmnd=FlashNextion ', desired_display_firmware_url].join('')), async function (error, response, result) { createState(NSPanel_Path + "TFT_Firmware.onlineVersion");