mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-21 15:04:24 +01:00
Merge branch 'joBr99:main' into main
This commit is contained in:
@@ -241,9 +241,13 @@ class LuiController(object):
|
|||||||
if button_type == "button":
|
if button_type == "button":
|
||||||
if entity_id.startswith('navigate'):
|
if entity_id.startswith('navigate'):
|
||||||
# internal for navigation to nested pages
|
# internal for navigation to nested pages
|
||||||
self._previous_cards.append(self._current_card)
|
dstCard = self._config.searchCard(entity_id)
|
||||||
self._current_card = self._config.searchCard(entity_id)
|
if dstCard is not None:
|
||||||
self._pages_gen.render_card(self._current_card)
|
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'):
|
elif entity_id.startswith('scene'):
|
||||||
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
||||||
elif entity_id.startswith('script'):
|
elif entity_id.startswith('script'):
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class LuiPagesGen(object):
|
|||||||
entity = self._ha_api.get_entity(statusIcon.get("entity"))
|
entity = self._ha_api.get_entity(statusIcon.get("entity"))
|
||||||
entityType = statusIcon.get("entity").split(".")[0]
|
entityType = statusIcon.get("entity").split(".")[0]
|
||||||
icon = get_icon_id_ha(entityType, state=entity.state, device_class=entity.attributes.get("device_class", ""), overwrite=icon)
|
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}"
|
status_res += f"~{icon}~{color}"
|
||||||
|
|
||||||
self._send_mqtt_msg(f"weatherUpdate~{icon_cur}~{text_cur}{weather_res}{altLayout}{status_res}")
|
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)
|
status_entity = self._ha_api.get_entity(item.status)
|
||||||
icon_color = self.get_entity_color(status_entity)
|
icon_color = self.get_entity_color(status_entity)
|
||||||
if item.status.startswith("sensor") and cardType == "cardGrid":
|
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:
|
else:
|
||||||
icon_color = 17299
|
icon_color = 17299
|
||||||
return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}"
|
return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*-----------------------------------------------------------------------
|
/*-----------------------------------------------------------------------
|
||||||
TypeScript zur Steuerung des SONOFF NSPanel mit dem ioBroker
|
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
|
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
|
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)
|
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:
|
Upgrades in Konsole:
|
||||||
Tasmota BerryDriver : Backlog UpdateDriverVersion https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be; Restart 1
|
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();
|
var Icons = new IconsSelector();
|
||||||
@@ -328,7 +328,7 @@ var WLAN: PageQR =
|
|||||||
"heading": "Gäste WLAN",
|
"heading": "Gäste WLAN",
|
||||||
"useColor": true,
|
"useColor": true,
|
||||||
"subPage": true,
|
"subPage": true,
|
||||||
"parent": WLAN,
|
"parent": Subpages_1,
|
||||||
"items": [<PageItem>{ id: "alias.0.NSPanel_1.Guest_Wifi" }]
|
"items": [<PageItem>{ id: "alias.0.NSPanel_1.Guest_Wifi" }]
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -550,7 +550,7 @@ check_updates();
|
|||||||
//------------------Begin Update Functions
|
//------------------Begin Update Functions
|
||||||
function check_updates() {
|
function check_updates() {
|
||||||
|
|
||||||
const desired_display_firmware_version = 36;
|
const desired_display_firmware_version = 37;
|
||||||
const berry_driver_version = 4;
|
const berry_driver_version = 4;
|
||||||
|
|
||||||
if (Debug) console.log("Check-Updates");
|
if (Debug) console.log("Check-Updates");
|
||||||
@@ -784,7 +784,7 @@ function update_berry_driver_version() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function update_tft_firmware() {
|
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"
|
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) {
|
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");
|
createState(NSPanel_Path + "TFT_Firmware.onlineVersion");
|
||||||
|
|||||||
Reference in New Issue
Block a user