Compare commits

...

8 Commits

Author SHA1 Message Date
joBr99
70211d563f fixes #798 2023-03-05 20:21:02 +01:00
joBr99
20743c3006 fixes #795 2023-03-05 20:07:21 +01:00
Johannes
fe401cc7c2 Update config.py 2023-03-05 10:19:39 +01:00
Johannes
b3d0d05fe0 Update config-overview.md 2023-03-05 10:16:21 +01:00
Johannes
006e8d37c1 Update config.py 2023-03-05 10:05:39 +01:00
Armilar
954733691f v4.0.4
- Fix bExit pageId with popup's
2023-03-04 13:11:42 +01:00
Armilar
48171d3256 v4.0.4
- Fix bExit pageId with popup's
2023-03-04 13:08:10 +01:00
Armilar
03938e05ea v4.0.4
- Fix bExit pageId with popup's
2023-03-04 13:05:50 +01:00
5 changed files with 33 additions and 22 deletions

View File

@@ -38,8 +38,12 @@ class Card(object):
self.cardType = card_input_config.get("type", "unknown") self.cardType = card_input_config.get("type", "unknown")
self.title = card_input_config.get("title", "unknown") self.title = card_input_config.get("title", "unknown")
self.key = card_input_config.get("key", "unknown") self.key = card_input_config.get("key", "unknown")
self.nav1Override = card_input_config.get("navItem1") self.nav1Override = None
self.nav2Override = card_input_config.get("navItem2") if card_input_config.get("navItem1"):
self.nav1Override = Entity(card_input_config.get("navItem1"))
self.nav2Override = None
if card_input_config.get("navItem2"):
self.nav2Override = Entity(card_input_config.get("navItem2"))
self.sleepTimeout = card_input_config.get("sleepTimeout") self.sleepTimeout = card_input_config.get("sleepTimeout")
self.last_update = 0 self.last_update = 0
self.cooldown = card_input_config.get("cooldown", 0) self.cooldown = card_input_config.get("cooldown", 0)
@@ -83,6 +87,10 @@ class Card(object):
if self.entities: if self.entities:
for e in self.entities: for e in self.entities:
entitys.append(e) entitys.append(e)
if self.nav1Override:
entitys.append(self.nav1Override)
if self.nav2Override:
entitys.append(self.nav2Override)
return entitys return entitys
@@ -120,7 +128,6 @@ class LuiBackendConfig(object):
'dateAdditionalTemplate': "", 'dateAdditionalTemplate': "",
'timeAdditionalTemplate': "", 'timeAdditionalTemplate': "",
'dateFormat': "%A, %d. %B %Y", 'dateFormat': "%A, %d. %B %Y",
'homeButton': False,
'cards': [{ 'cards': [{
'type': 'cardEntities', 'type': 'cardEntities',
'entities': [{ 'entities': [{

View File

@@ -492,7 +492,7 @@ class LuiPagesGen(object):
state_translation = get_translation(self._locale, "frontend.ui.panel.config.devices.entities.state") state_translation = get_translation(self._locale, "frontend.ui.panel.config.devices.entities.state")
action_translation = get_translation(self._locale, "frontend.ui.card.climate.operation").replace(' ','\r\n') action_translation = get_translation(self._locale, "frontend.ui.card.climate.operation").replace(' ','\r\n')
detailPage = "" detailPage = "1"
if any(x in ["preset_modes", "swing_modes", "fan_modes"] for x in entity.attributes): if any(x in ["preset_modes", "swing_modes", "fan_modes"] for x in entity.attributes):
detailPage = "0" detailPage = "0"
@@ -695,10 +695,10 @@ class LuiPagesGen(object):
rightBtn = "delete~~~~~" rightBtn = "delete~~~~~"
if card.nav1Override is not None: if card.nav1Override is not None:
leftBtn = self.generate_entities_item(Entity(card.nav1Override))[1:] leftBtn = self.generate_entities_item(card.nav1Override)[1:]
if card.nav2Override is not None: if card.nav2Override is not None:
rightBtn = self.generate_entities_item(Entity(card.nav2Override))[1:] rightBtn = self.generate_entities_item(card.nav2Override)[1:]
navigation = f"{leftBtn}~{rightBtn}" navigation = f"{leftBtn}~{rightBtn}"

View File

@@ -72,7 +72,8 @@ key | optional | type | default | description
`cards` | False | complex | | configuration for cards that are displayed on panel; see docs for cards `cards` | False | complex | | configuration for cards that are displayed on panel; see docs for cards
`screensaver` | True | complex | | configuration for screensaver; see docs for screensaver `screensaver` | True | complex | | configuration for screensaver; see docs for screensaver
`hiddenCards` | True | complex | | configuration for cards that can be accessed though navigate items; see docs for cards `hiddenCards` | True | complex | | configuration for cards that can be accessed though navigate items; see docs for cards
`homeButton` | True | boolean | False | show home button on subpages
## Details on sleepBrightness/screenBrightness and other configs related to screen brightness ## Details on sleepBrightness/screenBrightness and other configs related to screen brightness
It is possible to schedule a brightness change for the screen at specific times. It is possible to schedule a brightness change for the screen at specific times.

View File

@@ -1,6 +1,6 @@
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
TypeScript v4.0.3 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom TypeScript v4.0.4 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom
- abgestimmt auf TFT 50 / v4.0.3 / BerryDriver 8 / Tasmota 12.4.0 - abgestimmt auf TFT 50 / v4.0.4 / BerryDriver 8 / Tasmota 12.4.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)
@@ -114,6 +114,8 @@ ReleaseNotes:
- 27.02.2023 - v4.0.2 Dynamic Indicator Icons in Advanced Screensaver by Gargano - 27.02.2023 - v4.0.2 Dynamic Indicator Icons in Advanced Screensaver by Gargano
- 27.02.2023 - v4.0.2 Upgrade TFT 50 / 4.0.2 - 27.02.2023 - v4.0.2 Upgrade TFT 50 / 4.0.2
- 27.02.2023 - v4.0.3 Upgrade TFT 50 / 4.0.3 - 27.02.2023 - v4.0.3 Upgrade TFT 50 / 4.0.3
- 04.03.2023 - v4.0.4 Upgrade TFT 50 / 4.0.4
- 04.03.2023 - v4.0.4 Fix bExit with popupLight, popup....
*********************************************************************************************************** ***********************************************************************************************************
* Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObect" gesetzt sein! * * Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObect" gesetzt sein! *
@@ -203,7 +205,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-v4.0.3.tft TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v4.0.4.tft
--------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------
*/ */
let Icons = new IconsSelector(); let Icons = new IconsSelector();
@@ -1282,7 +1284,7 @@ export const config = <Config> {
const request = require('request'); const request = require('request');
//Desired Firmware //Desired Firmware
const tft_version: string = 'v4.0.3'; const tft_version: string = 'v4.0.4';
const desired_display_firmware_version = 50; const desired_display_firmware_version = 50;
const berry_driver_version = 8; const berry_driver_version = 8;
const tasmotaOtaUrl: string = 'http://ota.tasmota.com/tasmota32/release/'; const tasmotaOtaUrl: string = 'http://ota.tasmota.com/tasmota32/release/';
@@ -1295,7 +1297,7 @@ let globalTracklist: any;
async function Init_Release() { async function Init_Release() {
const FWVersion = [41,42,43,44,45,46,47,48,49,50,51,52] const FWVersion = [41,42,43,44,45,46,47,48,49,50,51,52]
const FWRelease = ['3.3.1','3.4.0','3.5.0','3.5.X','3.6.0','3.7.3','3.8.0','3.8.3','3.9.4','4.0.3','4.1.0','4.2.0'] const FWRelease = ['3.3.1','3.4.0','3.5.0','3.5.X','3.6.0','3.7.3','3.8.0','3.8.3','3.9.4','4.0.4','4.1.0','4.2.0']
try { try {
if (existsObject(NSPanel_Path + 'Display_Firmware.desiredVersion') == false) { if (existsObject(NSPanel_Path + 'Display_Firmware.desiredVersion') == false) {
await createStateAsync(NSPanel_Path + 'Display_Firmware.desiredVersion', desired_display_firmware_version, { type: 'number' }); await createStateAsync(NSPanel_Path + 'Display_Firmware.desiredVersion', desired_display_firmware_version, { type: 'number' });
@@ -5216,8 +5218,8 @@ function HandleButtonEvent(words: any): void {
pageId = getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val pageId = getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val
} }
} }
} activePage = config.pages[pageId];
activePage = config.pages[pageId]; }
GeneratePage(activePage); GeneratePage(activePage);
break; break;
case 'bHome': case 'bHome':

View File

@@ -1,6 +1,6 @@
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
TypeScript v4.0.3 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom TypeScript v4.0.4 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom
- abgestimmt auf TFT 50 / v4.0.3 / BerryDriver 8 / Tasmota 12.4.0 - abgestimmt auf TFT 50 / v4.0.4 / BerryDriver 8 / Tasmota 12.4.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)
@@ -114,7 +114,8 @@ ReleaseNotes:
- 27.02.2023 - v4.0.2 Dynamic Indicator Icons in Advanced Screensaver by Gargano - 27.02.2023 - v4.0.2 Dynamic Indicator Icons in Advanced Screensaver by Gargano
- 27.02.2023 - v4.0.2 Upgrade TFT 50 / 4.0.2 - 27.02.2023 - v4.0.2 Upgrade TFT 50 / 4.0.2
- 27.02.2023 - v4.0.3 Upgrade TFT 50 / 4.0.3 - 27.02.2023 - v4.0.3 Upgrade TFT 50 / 4.0.3
- 04.03.2023 - v4.0.4 Upgrade TFT 50 / 4.0.4
- 04.03.2023 - v4.0.4 Fix bExit with popupLight, popup....
*********************************************************************************************************** ***********************************************************************************************************
* Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObect" gesetzt sein! * * Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObect" gesetzt sein! *
@@ -204,7 +205,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-v4.0.3.tft TFT EU STABLE Version : FlashNextion http://nspanel.pky.eu/lovelace-ui/github/nspanel-v4.0.4.tft
--------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------
*/ */
let Icons = new IconsSelector(); let Icons = new IconsSelector();
@@ -771,7 +772,7 @@ export const config = <Config> {
const request = require('request'); const request = require('request');
//Desired Firmware //Desired Firmware
const tft_version: string = 'v4.0.3'; const tft_version: string = 'v4.0.4';
const desired_display_firmware_version = 50; const desired_display_firmware_version = 50;
const berry_driver_version = 8; const berry_driver_version = 8;
const tasmotaOtaUrl: string = 'http://ota.tasmota.com/tasmota32/release/'; const tasmotaOtaUrl: string = 'http://ota.tasmota.com/tasmota32/release/';
@@ -784,7 +785,7 @@ let globalTracklist: any;
async function Init_Release() { async function Init_Release() {
const FWVersion = [41,42,43,44,45,46,47,48,49,50,51,52] const FWVersion = [41,42,43,44,45,46,47,48,49,50,51,52]
const FWRelease = ['3.3.1','3.4.0','3.5.0','3.5.X','3.6.0','3.7.3','3.8.0','3.8.3','3.9.4','4.0.3','4.1.0','4.2.0'] const FWRelease = ['3.3.1','3.4.0','3.5.0','3.5.X','3.6.0','3.7.3','3.8.0','3.8.3','3.9.4','4.0.4','4.1.0','4.2.0']
try { try {
if (existsObject(NSPanel_Path + 'Display_Firmware.desiredVersion') == false) { if (existsObject(NSPanel_Path + 'Display_Firmware.desiredVersion') == false) {
await createStateAsync(NSPanel_Path + 'Display_Firmware.desiredVersion', desired_display_firmware_version, { type: 'number' }); await createStateAsync(NSPanel_Path + 'Display_Firmware.desiredVersion', desired_display_firmware_version, { type: 'number' });
@@ -4705,8 +4706,8 @@ function HandleButtonEvent(words: any): void {
pageId = getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val pageId = getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val
} }
} }
} activePage = config.pages[pageId];
activePage = config.pages[pageId]; }
GeneratePage(activePage); GeneratePage(activePage);
break; break;
case 'bHome': case 'bHome':