From b0b96dca58ce8df0c3dacea5038ef28d8006ff62 Mon Sep 17 00:00:00 2001 From: tt-tom17 <101348966+tt-tom17@users.noreply.github.com> Date: Fri, 10 Mar 2023 17:44:18 +0100 Subject: [PATCH] Version, Without-Examples-File --- ioBroker/NsPanelTs.ts | 7 ++++--- ioBroker/NsPanelTs_without_Examples.ts | 29 +++++++++++++------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index 1b0d3c5e..5ba2a31c 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------- -TypeScript v4.0.4.1 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom +TypeScript v4.0.4.2 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom - 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 NsPanelTs.ts (dieses TypeScript in ioBroker) Stable: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/NsPanelTs.ts @@ -117,6 +117,7 @@ ReleaseNotes: - 04.03.2023 - v4.0.4 Upgrade TFT 50 / 4.0.4 - 04.03.2023 - v4.0.4 Fix bExit with popupLight, popup.... - 07.03.2023 - v4.0.4.1 Extend Configuration Options for Physical Buttons to enable direct state manipulation - by bembelstemmer + - 10.03.2023 - v4.0.4.2 Fix iconColor by 100% Brightness *********************************************************************************************************** * Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObect" gesetzt sein! * @@ -5245,8 +5246,8 @@ function HandleButtonEvent(words: any): void { pageId = getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val } } - activePage = config.pages[pageId]; - } + activePage = config.pages[pageId]; + } GeneratePage(activePage); break; case 'bHome': diff --git a/ioBroker/NsPanelTs_without_Examples.ts b/ioBroker/NsPanelTs_without_Examples.ts index 4df189ed..11a76af5 100644 --- a/ioBroker/NsPanelTs_without_Examples.ts +++ b/ioBroker/NsPanelTs_without_Examples.ts @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------- -TypeScript v4.0.4.1 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom +TypeScript v4.0.4.2 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom - 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 NsPanelTs.ts (dieses TypeScript in ioBroker) Stable: https://github.com/joBr99/nspanel-lovelace-ui/blob/main/ioBroker/NsPanelTs.ts @@ -117,7 +117,8 @@ ReleaseNotes: - 04.03.2023 - v4.0.4 Upgrade TFT 50 / 4.0.4 - 04.03.2023 - v4.0.4 Fix bExit with popupLight, popup.... - 07.03.2023 - v4.0.4.1 Extend Configuration Options for Physical Buttons to enable direct state manipulation - by bembelstemmer - + - 10.03.2023 - v4.0.4.2 Fix iconColor by 100% Brightness + *********************************************************************************************************** * Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObect" gesetzt sein! * *********************************************************************************************************** @@ -2805,7 +2806,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean = if (val === true || val === 'true') { optVal = '1'; - iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.DIMMER') ? 100 - getState(pageItem.id + '.DIMMER').val : true, useColors); + iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.DIMMER') ? getState(pageItem.id + '.DIMMER').val : true, useColors); } else { iconColor = GetIconColor(pageItem, false, useColors); if (pageItem.icon !== undefined) { @@ -2834,7 +2835,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean = if (val === true || val === 'true') { optVal = '1'; - iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.DIMMER') ? 100 - getState(pageItem.id + '.DIMMER').val : true, useColors); + iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.DIMMER') ? getState(pageItem.id + '.DIMMER').val : true, useColors); } else { iconColor = GetIconColor(pageItem, false, useColors); if (pageItem.icon !== undefined) { @@ -2853,7 +2854,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean = if (val === true || val === 'true') { optVal = '1'; - iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.DIMMER') ? 100 - getState(pageItem.id + '.DIMMER').val : true, useColors); + iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.DIMMER') ? getState(pageItem.id + '.DIMMER').val : true, useColors); } else { iconColor = GetIconColor(pageItem, false, useColors); if (pageItem.icon !== undefined) { @@ -2883,7 +2884,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean = if (val === true || val === 'true') { optVal = '1' - iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.DIMMER') ? 100 - getState(pageItem.id + '.DIMMER').val : true, useColors); + iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.DIMMER') ? getState(pageItem.id + '.DIMMER').val : true, useColors); } else { iconColor = GetIconColor(pageItem, false, useColors); if (pageItem.icon !== undefined) { @@ -2913,7 +2914,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean = if (val === true || val === 'true') { optVal = '1'; - iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.ACTUAL') ? 100 - getState(pageItem.id + '.ACTUAL').val : true, useColors); + iconColor = GetIconColor(pageItem, existsState(pageItem.id + '.ACTUAL') ? getState(pageItem.id + '.ACTUAL').val : true, useColors); } else { iconColor = GetIconColor(pageItem, false, useColors); if (pageItem.icon !== undefined) { @@ -4733,8 +4734,8 @@ function HandleButtonEvent(words: any): void { pageId = getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val } } - activePage = config.pages[pageId]; - } + activePage = config.pages[pageId]; + } GeneratePage(activePage); break; case 'bHome': @@ -5558,7 +5559,7 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem): } if (val === true) { - iconColor = GetIconColor(pageItem, 100 - brightness, true); + iconColor = GetIconColor(pageItem, brightness, true); switchVal = '1'; } else { iconColor = GetIconColor(pageItem, false, true); @@ -5602,7 +5603,7 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem): } if (val === true) { - iconColor = GetIconColor(pageItem, 100 - brightness, true); + iconColor = GetIconColor(pageItem, brightness, true); switchVal = '1'; } else { iconColor = GetIconColor(pageItem, false, true); @@ -5668,7 +5669,7 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem): } if (val === true) { - iconColor = GetIconColor(pageItem, 100 - brightness, true); + iconColor = GetIconColor(pageItem, brightness, true); switchVal = '1'; } else { iconColor = GetIconColor(pageItem, false, true); @@ -5733,7 +5734,7 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem): } if (val === true) { - iconColor = GetIconColor(pageItem, 100 - brightness, true); + iconColor = GetIconColor(pageItem, brightness, true); switchVal = '1'; } else { iconColor = GetIconColor(pageItem, false, true); @@ -5802,7 +5803,7 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem): } if (val === true) { - iconColor = GetIconColor(pageItem, 100 - brightness, true); + iconColor = GetIconColor(pageItem, brightness, true); switchVal = '1'; } else { iconColor = GetIconColor(pageItem, false, true);