Compare commits

...

28 Commits

Author SHA1 Message Date
theknut
29ae1b4034 fix: wrong yAxisTicks logged in debug log 2024-01-19 10:34:50 +01:00
theknut
ae5cab9830 refactor: ensure yAxisTicks are calculated every time if not provided 2024-01-19 10:27:01 +01:00
theknut
a986e588b5 feat: calculate yAxisTicks based on given values
If no yAxisTicks are provided for the signal, try to calculate it based on the given values.
2024-01-19 00:27:10 +01:00
Armilar
e94c711f12 v4.3.3.37 - Update NSPanelTs.ts
Change: Allow data points to be flushed for popUpNotify. Activate screensaver with one click.
2024-01-15 11:00:22 +01:00
Armilar
4cc8455fff v4.3.3.36 - Update NsPanelTs.ts
- v4.3.3.34 Fix: Disabled Icon Status for Blinds while bug in updating data points in ioBroker (reason unknown)
- v4.3.3.35 Add: relay.1/relay.2 show the confirmed status
- v4.3.3.36 Fix: change ScreensaverTimeout and activeBrightness
- v4.3.3.36 Fix: schedule SendTime
- v4.3.3.36 Fix: Some Types and Minor Fixes
2024-01-14 20:46:19 +01:00
Armilar
943bb93398 v4.3.3.36 - Update NsPanelTs.ts
- v4.3.3.34 Fix: Disabled Icon Status while bug in updating data points in ioBroker (reason unknown)
- v4.3.3.35 Add: relay.1/relay.2 show the confirmed status
- v4.3.3.36 Fix: change ScreensaverTimeout and activeBrightness
- v4.3.3.36 Fix: schedule SendTime
- v4.3.3.36 Fix: Some Types and Minor Fixes
2024-01-14 20:43:14 +01:00
Armilar
0a1eb8c2e5 v4.3.3.26 - Update NsPanelTs.ts
- v4.3.3.34 Fix: Disabled Icon Status while bug in updating data points in ioBroker (reason unknown)
- v4.3.3.35 Add: relay.1/relay.2 show the confirmed status
- v4.3.3.36 Fix: change ScreensaverTimeout and activeBrightness
- v4.3.3.36 Fix: schedule SendTime
- v4.3.3.36 Fix: Function _schedule SummerTime/WinterTime

- v4.3.3.34 Fix: Disabled Icon Status while bug in updating data points in ioBroker (reason unknown)
- v4.3.3.35 Add: relay.1/relay.2 show the confirmed status
- v4.3.3.36 Fix: change ScreensaverTimeout and activeBrightness
- v4.3.3.36 Fix: schedule SendTime
- v4.3.3.36 Fix: Some Types and Minor Fixes
2024-01-14 20:41:38 +01:00
Armilar
bc69af7b6b v4.3.3.36 - Update NSPanelTs.ts
Add common write false/true
2024-01-11 12:51:34 +01:00
Armilar
c36202878f Update ioBroker_NSPanel_locales_service.json 2024-01-11 12:00:26 +01:00
Armilar
60f31595d4 v4.3.3.36 - Update NSPanelTs.ts 2024-01-10 22:39:48 +01:00
Armilar
7194d7f613 v4.3.3.36 - Update NSPanelTs.ts
Fix Alexa Elapsed
2024-01-10 22:31:29 +01:00
Armilar
af02a70600 Merge pull request #1138 from ticaki/main
Fixed: schedule with objects starts only 1 time
2024-01-10 22:27:01 +01:00
ticaki
77d8e0607d Merge branch 'joBr99:main' into main 2024-01-10 22:21:08 +01:00
ticaki
d6d12bc93c Fixed: schedule with objects starts only 1 time 2024-01-10 22:19:44 +01:00
Armilar
ead1def4bb Merge pull request #1134 from tt-tom17/main
v4.3.3.36 Update NSPanel.ts
2024-01-09 22:57:12 +01:00
Thomas
14e944885f v4.3.3.36 Update NSPanel.ts
- Fix: change ScreensaverTimeout and activeBrightness
- Fix: schedule SendTime
- Fix: Function _schedule SummerTime/WinterTime
2024-01-09 22:37:18 +01:00
Armilar
a075e0cba8 Merge pull request #1133 from ticaki/main
2 Fixes
2024-01-09 21:46:44 +01:00
ticaki
dd14e66f10 update summer/winter fix 2024-01-09 21:24:52 +01:00
ticaki
ce0892b986 Fixed: update every minute
Fixed:  Schedule: {hour: minutes:} works with summer/winter time
2024-01-09 21:09:56 +01:00
Armilar
71b84cc8d3 Merge pull request #1131 from ticaki/main
schedule, 1 extendObject, relay show status of tasmota
2024-01-09 18:03:02 +01:00
ticaki
fd3ce243a6 update on replace 2024-01-08 22:29:08 +01:00
ticaki
aa3e90ef98 Get dp from NSPanelSendTopic 2024-01-08 22:23:06 +01:00
ticaki
2621b22ffd fix schedule 2024-01-08 21:55:53 +01:00
ticaki
6460f5f4ff Merge branch 'joBr99:main' into main 2024-01-08 20:28:46 +01:00
ticaki
e45560c27f add relays show status 2024-01-08 20:22:41 +01:00
ticaki
0c6cd158dd change schedule (testing needed)
add 1 extendObjectfor bgColorIndicator
2024-01-08 18:52:33 +01:00
dependabot[bot]
f11de05eb3 Bump github/codeql-action from 2 to 3 (#1094)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 16:38:05 +01:00
Armilar
ef47efb9aa Merge pull request #1130 from joBr99/Armilar-patch-4
v4.3.3.34 - Bose Soundtouch final Proto
2024-01-08 11:33:06 +01:00
4 changed files with 1147 additions and 824 deletions

View File

@@ -47,7 +47,7 @@ jobs:
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v2 uses: github/codeql-action/init@v3
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file. # If you wish to specify custom queries, you can do so here or in a config file.
@@ -58,7 +58,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below) # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@v2 uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell. # Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl # 📚 https://git.io/JvXDl
@@ -72,4 +72,4 @@ jobs:
# make release # make release
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2 uses: github/codeql-action/analyze@v3

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
TypeScript v4.3.3.34 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @ticaki / @Britzelpuf / @Sternmiere / @ravenS0ne TypeScript v4.3.3.37 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @ticaki / @Britzelpuf / @Sternmiere / @ravenS0ne
- abgestimmt auf TFT 53 / v4.3.3 / BerryDriver 9 / Tasmota 13.3.0 - abgestimmt auf TFT 53 / v4.3.3 / BerryDriver 9 / Tasmota 13.3.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
@@ -89,10 +89,15 @@ ReleaseNotes:
- 04.01.2024 - v4.3.3.32 Add more details to types for: leftScreensaverEntity, indicatorScreensaverEntity, PageThermo, PageMedia - 04.01.2024 - v4.3.3.32 Add more details to types for: leftScreensaverEntity, indicatorScreensaverEntity, PageThermo, PageMedia
- 04.01.2024 - v4.3.3.32 Remove not uses propertys from PageItem - 04.01.2024 - v4.3.3.32 Remove not uses propertys from PageItem
- 05.01.2024 - v4.3.3.32 Add Body for BoseSoundtouch-Player - 05.01.2024 - v4.3.3.32 Add Body for BoseSoundtouch-Player
- 05.01.2024 - v4.3.3.33 Add BoseSoundtouch Functions - 05.01.2024 - v4.3.3.33 Add BoseSoundtouch Functions
- 05.01.2024 - v4.3.3.33 Screensaver Fix max Number of indicatorScreensaverEntity - 05.01.2024 - v4.3.3.33 Screensaver Fix max Number of indicatorScreensaverEntity
- 07.01.2024 - v4.3.3.33 Fix BoseSoundtouch Proto - 07.01.2024 - v4.3.3.33 Fix BoseSoundtouch Proto
- 08.01.2024 - v4.3.3.34 Fix: Disabled Icon Status while bug in updating data points in ioBroker (reason unknown) - 08.01.2024 - v4.3.3.34 Fix: Disabled Icon Status while bug in updating data points in ioBroker (reason unknown)
- 08.01.2024 - v4.3.3.35 Add: relay.1/relay.2 show the confirmed status
- 09.01.2024 - v4.3.3.36 Fix: change ScreensaverTimeout and activeBrightness
- 09.01.2024 - v4.3.3.36 Fix: schedule SendTime
- 09.01.2024 - v4.3.3.36 Fix: Function _schedule SummerTime/WinterTime
- 15.01.2024 - v4.3.3.37 Change: Allow data points to be flushed for popUpNotify. Activate screensaver with one click.
Todo: Todo:
- XX.XX.XXXX - v5.0.0 Change the bottomScreensaverEntity (rolling) if more than 6 entries are defined - XX.XX.XXXX - v5.0.0 Change the bottomScreensaverEntity (rolling) if more than 6 entries are defined
@@ -911,10 +916,11 @@ export const config: Config = {
ScreensaverEntityOnColor: On, ScreensaverEntityOnColor: On,
ScreensaverEntityOffColor: HMIOff ScreensaverEntityOffColor: HMIOff
}, },
// ------ DE: Ende der Screensaver Einstellungen -------------------- // ------ DE: Ende der Screensaver Einstellungen --------------------
// ------ EN: End of screensaver settings --------------------------- // ------ EN: End of screensaver settings ---------------------------
//-------DE: Anfang Einstellungen für Hardware Button, wenn Sie softwareseitig genutzt werden (Rule2) -------------
//-------EN: Start Settings for Hardware Button, if used in software (Rule2) -------------------------------------- //-------DE: Anfang Einstellungen für Hardware Button, wenn Sie softwareseitig genutzt werden (Rule2) -------------
//-------EN: Start Settings for Hardware Button, if used in software (Rule2) --------------------------------------
// DE: Konfiguration des linken Schalters des NSPanels // DE: Konfiguration des linken Schalters des NSPanels
// EN: Configuration of the left switch of the NSPanel // EN: Configuration of the left switch of the NSPanel
button1: { button1: {
@@ -940,8 +946,10 @@ export const config: Config = {
entity: null, entity: null,
setValue: null setValue: null
}, },
//--------- DE: Ende - Einstellungen für Hardware Button, wenn Sie softwareseitig genutzt werden (Rule2) -------------
//--------- EN: End - settings for hardware button if they are used in software (Rule2) ------------------------------ //--------- DE: Ende - Einstellungen für Hardware Button, wenn Sie softwareseitig genutzt werden (Rule2) -------------
//--------- EN: End - settings for hardware button if they are used in software (Rule2) ------------------------------
// DE: WICHTIG !! Parameter nicht ändern WICHTIG!! // DE: WICHTIG !! Parameter nicht ändern WICHTIG!!
// EN: IMPORTANT !! Do not change parameters IMPORTANT!! // EN: IMPORTANT !! Do not change parameters IMPORTANT!!
panelRecvTopic: NSPanelReceiveTopic, panelRecvTopic: NSPanelReceiveTopic,
@@ -956,7 +964,7 @@ export const config: Config = {
// _________________________________ DE: Ab hier keine Konfiguration mehr _____________________________________ // _________________________________ DE: Ab hier keine Konfiguration mehr _____________________________________
// _________________________________ EN: No more configuration from here _____________________________________ // _________________________________ EN: No more configuration from here _____________________________________
const scriptVersion: string = 'v4.3.3.34'; const scriptVersion: string = 'v4.3.3.37';
const tft_version: string = 'v4.3.3'; const tft_version: string = 'v4.3.3';
const desired_display_firmware_version = 53; const desired_display_firmware_version = 53;
const berry_driver_version = 9; const berry_driver_version = 9;
@@ -976,6 +984,8 @@ const moment = require('moment');
const parseFormat = require('moment-parseformat'); const parseFormat = require('moment-parseformat');
moment.locale(getState(NSPanel_Path + 'Config.locale').val); moment.locale(getState(NSPanel_Path + 'Config.locale').val);
const scheduleList:{[key:string]: any} = {};
const globalTextColor: any = White; const globalTextColor: any = White;
const Sliders2: number = 0; const Sliders2: number = 0;
let checkBlindActive: boolean = false; let checkBlindActive: boolean = false;
@@ -1014,13 +1024,13 @@ let scheduleInitDimModeDay: any;
let scheduleInitDimModeNight: any; let scheduleInitDimModeNight: any;
onStop (function scriptStop () { onStop (function scriptStop () {
if (scheduleSendTime!=null) clearSchedule(scheduleSendTime); if (scheduleSendTime!=null) _clearSchedule(scheduleSendTime);
if (scheduleSendDate!=null) clearSchedule(scheduleSendDate); if (scheduleSendDate!=null) _clearSchedule(scheduleSendDate);
if (scheduleSwichScreensaver!=null) clearSchedule(scheduleSwichScreensaver); if (scheduleSwichScreensaver!=null) _clearSchedule(scheduleSwichScreensaver);
if (scheduleStartup!=null) clearSchedule(scheduleStartup); if (scheduleStartup!=null) _clearSchedule(scheduleStartup);
if (scheduleCheckUpdates!=null) clearSchedule(scheduleCheckUpdates); if (scheduleCheckUpdates!=null) _clearSchedule(scheduleCheckUpdates);
if (scheduleInitDimModeDay!=null) clearSchedule(scheduleInitDimModeDay); if (scheduleInitDimModeDay!=null) _clearSchedule(scheduleInitDimModeDay);
if (scheduleInitDimModeNight!=null) clearSchedule(scheduleInitDimModeNight); if (scheduleInitDimModeNight!=null) _clearSchedule(scheduleInitDimModeNight);
UnsubscribeWatcher(); UnsubscribeWatcher();
}, 1000); }, 1000);
@@ -1108,19 +1118,19 @@ async function InitIoBrokerInfo() {
try { try {
if (isSetOptionActive) { if (isSetOptionActive) {
// Script Version // Script Version
await createStateAsync(NSPanel_Path + 'IoBroker.ScriptVersion', scriptVersion, { type: 'string' }); await createStateAsync(NSPanel_Path + 'IoBroker.ScriptVersion', scriptVersion, { type: 'string', write: false });
setObject(AliasPath + 'IoBroker.ScriptVersion', {type: 'channel', common: {role: 'info', name:'Version NSPanelTS'}, native: {}}); setObject(AliasPath + 'IoBroker.ScriptVersion', {type: 'channel', common: {role: 'info', name:'Version NSPanelTS'}, native: {}});
await createAliasAsync(AliasPath + 'IoBroker.ScriptVersion.ACTUAL', NSPanel_Path + 'IoBroker.ScriptVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'IoBroker.ScriptVersion.ACTUAL', NSPanel_Path + 'IoBroker.ScriptVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' });
// NodeJS Verion // NodeJS Verion
await createStateAsync(NSPanel_Path + 'IoBroker.NodeJSVersion', 'v' + nodeVersion, { type: 'string' }); await createStateAsync(NSPanel_Path + 'IoBroker.NodeJSVersion', 'v' + nodeVersion, { type: 'string', write: false });
setObject(AliasPath + 'IoBroker.NodeJSVersion', {type: 'channel', common: {role: 'info', name:'Version NodeJS'}, native: {}}); setObject(AliasPath + 'IoBroker.NodeJSVersion', {type: 'channel', common: {role: 'info', name:'Version NodeJS'}, native: {}});
await createAliasAsync(AliasPath + 'IoBroker.NodeJSVersion.ACTUAL', NSPanel_Path + 'IoBroker.NodeJSVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'IoBroker.NodeJSVersion.ACTUAL', NSPanel_Path + 'IoBroker.NodeJSVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' });
// JavaScript Version // JavaScript Version
await createStateAsync(NSPanel_Path + 'IoBroker.JavaScriptVersion', 'v' + javaScriptVersion, { type: 'string' }); await createStateAsync(NSPanel_Path + 'IoBroker.JavaScriptVersion', 'v' + javaScriptVersion, { type: 'string', write: false });
setObject(AliasPath + 'IoBroker.JavaScriptVersion', {type: 'channel', common: {role: 'info', name:'Version JavaScript Instanz'}, native: {}}); setObject(AliasPath + 'IoBroker.JavaScriptVersion', {type: 'channel', common: {role: 'info', name:'Version JavaScript Instanz'}, native: {}});
await createAliasAsync(AliasPath + 'IoBroker.JavaScriptVersion.ACTUAL', NSPanel_Path + 'IoBroker.JavaScriptVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'IoBroker.JavaScriptVersion.ACTUAL', NSPanel_Path + 'IoBroker.JavaScriptVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' });
// ScriptName // ScriptName
await createStateAsync(NSPanel_Path + 'IoBroker.ScriptName', 'v' + javaScriptVersion, { type: 'string' }); await createStateAsync(NSPanel_Path + 'IoBroker.ScriptName', 'v' + javaScriptVersion, { type: 'string', write: false });
setObject(AliasPath + 'IoBroker.ScriptName', {type: 'channel', common: {role: 'info', name:'Scriptname'}, native: {}}); setObject(AliasPath + 'IoBroker.ScriptName', {type: 'channel', common: {role: 'info', name:'Scriptname'}, native: {}});
await createAliasAsync(AliasPath + 'IoBroker.ScriptName.ACTUAL', NSPanel_Path + 'IoBroker.ScriptName', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'IoBroker.ScriptName.ACTUAL', NSPanel_Path + 'IoBroker.ScriptName', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' });
} }
@@ -1134,7 +1144,7 @@ InitIoBrokerInfo();
async function CheckDebugMode() { async function CheckDebugMode() {
try { try {
if (isSetOptionActive) { if (isSetOptionActive) {
await createStateAsync(NSPanel_Path + 'Config.ScripgtDebugStatus', false, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.ScripgtDebugStatus', false, { type: 'boolean', write: true });
setObject(AliasPath + 'Config.ScripgtDebugStatus', {type: 'channel', common: {role: 'socket', name:'ScripgtDebugStatus'}, native: {}}); setObject(AliasPath + 'Config.ScripgtDebugStatus', {type: 'channel', common: {role: 'socket', name:'ScripgtDebugStatus'}, native: {}});
await createAliasAsync(AliasPath + 'Config.ScripgtDebugStatus.ACTUAL', NSPanel_Path + 'Config.ScripgtDebugStatus', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Config.ScripgtDebugStatus.ACTUAL', NSPanel_Path + 'Config.ScripgtDebugStatus', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'Config.ScripgtDebugStatus.SET', NSPanel_Path + 'Config.ScripgtDebugStatus', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' }); await createAliasAsync(AliasPath + 'Config.ScripgtDebugStatus.SET', NSPanel_Path + 'Config.ScripgtDebugStatus', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' });
@@ -1159,7 +1169,7 @@ async function CheckMQTTPorts() {
let instanceName: string = config.panelRecvTopic.substring(0,6); let instanceName: string = config.panelRecvTopic.substring(0,6);
if (isSetOptionActive) { if (isSetOptionActive) {
await createStateAsync(NSPanel_Path + 'Config.MQTT.portCheck', true, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.MQTT.portCheck', true, { type: 'boolean', write: true });
setObject(AliasPath + 'Config.MQTT.portCheck', {type: 'channel', common: {role: 'socket', name:'mqttPortCheck'}, native: {}}); setObject(AliasPath + 'Config.MQTT.portCheck', {type: 'channel', common: {role: 'socket', name:'mqttPortCheck'}, native: {}});
await createAliasAsync(AliasPath + 'Config.MQTT.portCheck.ACTUAL', NSPanel_Path + 'Config.MQTT.portCheck', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Config.MQTT.portCheck.ACTUAL', NSPanel_Path + 'Config.MQTT.portCheck', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'Config.MQTT.portCheck.SET', NSPanel_Path + 'Config.MQTT.portCheck', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' }); await createAliasAsync(AliasPath + 'Config.MQTT.portCheck.SET', NSPanel_Path + 'Config.MQTT.portCheck', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' });
@@ -1217,13 +1227,13 @@ async function Init_Release() {
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.5','4.1.4','4.2.1','4.3.3','4.4.0','4.5.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.5','4.1.4','4.2.1','4.3.3','4.4.0','4.5.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', write: false });
} else { } else {
await setStateAsync(NSPanel_Path + 'Display_Firmware.desiredVersion', desired_display_firmware_version); await setStateAsync(NSPanel_Path + 'Display_Firmware.desiredVersion', desired_display_firmware_version);
} }
if (existsObject(NSPanel_Path + 'Config.Update.activ') == false) { if (existsObject(NSPanel_Path + 'Config.Update.activ') == false) {
await createStateAsync(NSPanel_Path + 'Config.Update.activ', 1, { type: 'number' }); await createStateAsync(NSPanel_Path + 'Config.Update.activ', 1, { type: 'number', write: false });
} else { } else {
await setStateAsync(NSPanel_Path + 'Config.Update.activ', 0); await setStateAsync(NSPanel_Path + 'Config.Update.activ', 0);
} }
@@ -1240,8 +1250,8 @@ async function Init_Release() {
if (existsObject(NSPanel_Path + 'Display_Firmware.TFT.desiredVersion') == false) { if (existsObject(NSPanel_Path + 'Display_Firmware.TFT.desiredVersion') == false) {
//Create TFT DP's //Create TFT DP's
if (isSetOptionActive) { if (isSetOptionActive) {
await createStateAsync(NSPanel_Path + 'Display_Firmware.TFT.currentVersion', currentFW + ' / v' + FWRelease[findFWIndex], { type: 'string' }); await createStateAsync(NSPanel_Path + 'Display_Firmware.TFT.currentVersion', currentFW + ' / v' + FWRelease[findFWIndex], { type: 'string', write: false });
await createStateAsync(NSPanel_Path + 'Display_Firmware.TFT.desiredVersion', desired_display_firmware_version, { type: 'string' }); await createStateAsync(NSPanel_Path + 'Display_Firmware.TFT.desiredVersion', desired_display_firmware_version, { type: 'string', write: false });
setObject(AliasPath + 'Display_Firmware.TFT.currentVersion', {type: 'channel', common: {role: 'info', name:'current TFT-Version'}, native: {}}); setObject(AliasPath + 'Display_Firmware.TFT.currentVersion', {type: 'channel', common: {role: 'info', name:'current TFT-Version'}, native: {}});
setObject(AliasPath + 'Display_Firmware.TFT.desiredVersion', {type: 'channel', common: {role: 'info', name:'desired TFT-Version'}, native: {}}); setObject(AliasPath + 'Display_Firmware.TFT.desiredVersion', {type: 'channel', common: {role: 'info', name:'desired TFT-Version'}, native: {}});
await createAliasAsync(AliasPath + 'Display_Firmware.TFT.currentVersion.ACTUAL', NSPanel_Path + 'Display_Firmware.TFT.currentVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Display_Firmware.TFT.currentVersion.ACTUAL', NSPanel_Path + 'Display_Firmware.TFT.currentVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' });
@@ -1262,54 +1272,54 @@ async function InitConfigParameters() {
try { try {
if (isSetOptionActive) { if (isSetOptionActive) {
// alternativeScreensaverLayout (socket) // alternativeScreensaverLayout (socket)
await createStateAsync(NSPanel_Path + 'Config.Screensaver.alternativeScreensaverLayout', false, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.Screensaver.alternativeScreensaverLayout', false, { type: 'boolean', write: true });
setObject(AliasPath + 'Config.Screensaver.alternativeScreensaverLayout', {type: 'channel', common: {role: 'socket', name:'alternativeScreensaverLayout'}, native: {}}); setObject(AliasPath + 'Config.Screensaver.alternativeScreensaverLayout', {type: 'channel', common: {role: 'socket', name:'alternativeScreensaverLayout'}, native: {}});
await createAliasAsync(AliasPath + 'Config.Screensaver.alternativeScreensaverLayout.ACTUAL', NSPanel_Path + 'Config.Screensaver.alternativeScreensaverLayout', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Config.Screensaver.alternativeScreensaverLayout.ACTUAL', NSPanel_Path + 'Config.Screensaver.alternativeScreensaverLayout', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'Config.Screensaver.alternativeScreensaverLayout.SET', NSPanel_Path + 'Config.Screensaver.alternativeScreensaverLayout', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' }); await createAliasAsync(AliasPath + 'Config.Screensaver.alternativeScreensaverLayout.SET', NSPanel_Path + 'Config.Screensaver.alternativeScreensaverLayout', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' });
await createStateAsync(NSPanel_Path + 'Config.Screensaver.ScreensaverAdvanced', false, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.Screensaver.ScreensaverAdvanced', false, { type: 'boolean', write: true });
setObject(AliasPath + 'Config.Screensaver.ScreensaverAdvanced', {type: 'channel', common: {role: 'socket', name:'ScreensaverAdvanced'}, native: {}}); setObject(AliasPath + 'Config.Screensaver.ScreensaverAdvanced', {type: 'channel', common: {role: 'socket', name:'ScreensaverAdvanced'}, native: {}});
await createAliasAsync(AliasPath + 'Config.Screensaver.ScreensaverAdvanced.ACTUAL', NSPanel_Path + 'Config.Screensaver.ScreensaverAdvanced', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Config.Screensaver.ScreensaverAdvanced.ACTUAL', NSPanel_Path + 'Config.Screensaver.ScreensaverAdvanced', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'Config.Screensaver.ScreensaverAdvanced.SET', NSPanel_Path + 'Config.Screensaver.ScreensaverAdvanced', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' }); await createAliasAsync(AliasPath + 'Config.Screensaver.ScreensaverAdvanced.SET', NSPanel_Path + 'Config.Screensaver.ScreensaverAdvanced', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' });
// autoWeatherColorScreensaverLayout (socket) // autoWeatherColorScreensaverLayout (socket)
await createStateAsync(NSPanel_Path + 'Config.Screensaver.autoWeatherColorScreensaverLayout', true, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.Screensaver.autoWeatherColorScreensaverLayout', true, { type: 'boolean', write: true });
setObject(AliasPath + 'Config.Screensaver.autoWeatherColorScreensaverLayout', {type: 'channel', common: {role: 'socket', name:'alternativeScreensaverLayout'}, native: {}}); setObject(AliasPath + 'Config.Screensaver.autoWeatherColorScreensaverLayout', {type: 'channel', common: {role: 'socket', name:'alternativeScreensaverLayout'}, native: {}});
await createAliasAsync(AliasPath + 'Config.Screensaver.autoWeatherColorScreensaverLayout.ACTUAL', NSPanel_Path + 'Config.Screensaver.autoWeatherColorScreensaverLayout', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Config.Screensaver.autoWeatherColorScreensaverLayout.ACTUAL', NSPanel_Path + 'Config.Screensaver.autoWeatherColorScreensaverLayout', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'Config.Screensaver.autoWeatherColorScreensaverLayout.SET', NSPanel_Path + 'Config.Screensaver.autoWeatherColorScreensaverLayout', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' }); await createAliasAsync(AliasPath + 'Config.Screensaver.autoWeatherColorScreensaverLayout.SET', NSPanel_Path + 'Config.Screensaver.autoWeatherColorScreensaverLayout', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' });
// timeoutScreensaver 0-60 (Slider) // timeoutScreensaver 0-60 (Slider)
await createStateAsync(NSPanel_Path + 'Config.Screensaver.timeoutScreensaver', 10, { type: 'number' }); await createStateAsync(NSPanel_Path + 'Config.Screensaver.timeoutScreensaver', 10, { type: 'number', write: true });
setObject(AliasPath + 'Config.Screensaver.timeoutScreensaver', {type: 'channel', common: {role: 'slider', name:'timeoutScreensaver'}, native: {}}); setObject(AliasPath + 'Config.Screensaver.timeoutScreensaver', {type: 'channel', common: {role: 'slider', name:'timeoutScreensaver'}, native: {}});
await createAliasAsync(AliasPath + 'Config.Screensaver.timeoutScreensaver.ACTUAL', NSPanel_Path + 'Config.Screensaver.timeoutScreensaver', true, <iobJS.StateCommon>{ type: 'number', role: 'value', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Config.Screensaver.timeoutScreensaver.ACTUAL', NSPanel_Path + 'Config.Screensaver.timeoutScreensaver', true, <iobJS.StateCommon>{ type: 'number', role: 'value', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'Config.Screensaver.timeoutScreensaver.SET', NSPanel_Path + 'Config.Screensaver.timeoutScreensaver', true, <iobJS.StateCommon>{ type: 'number', role: 'level', name: 'SET' }); await createAliasAsync(AliasPath + 'Config.Screensaver.timeoutScreensaver.SET', NSPanel_Path + 'Config.Screensaver.timeoutScreensaver', true, <iobJS.StateCommon>{ type: 'number', role: 'level', name: 'SET' });
// screenSaverDoubleClick (socket) // screenSaverDoubleClick (socket)
await createStateAsync(NSPanel_Path + 'Config.Screensaver.screenSaverDoubleClick', true, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.Screensaver.screenSaverDoubleClick', true, { type: 'boolean', write: true });
setObject(AliasPath + 'Config.Screensaver.screenSaverDoubleClick', {type: 'channel', common: {role: 'socket', name:'screenSaverDoubleClick'}, native: {}}); setObject(AliasPath + 'Config.Screensaver.screenSaverDoubleClick', {type: 'channel', common: {role: 'socket', name:'screenSaverDoubleClick'}, native: {}});
await createAliasAsync(AliasPath + 'Config.Screensaver.screenSaverDoubleClick.ACTUAL', NSPanel_Path + 'Config.Screensaver.screenSaverDoubleClick', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Config.Screensaver.screenSaverDoubleClick.ACTUAL', NSPanel_Path + 'Config.Screensaver.screenSaverDoubleClick', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'Config.Screensaver.screenSaverDoubleClick.SET', NSPanel_Path + 'Config.Screensaver.screenSaverDoubleClick', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' }); await createAliasAsync(AliasPath + 'Config.Screensaver.screenSaverDoubleClick.SET', NSPanel_Path + 'Config.Screensaver.screenSaverDoubleClick', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' });
if (existsObject(NSPanel_Path + 'Config.locale') == false) { if (existsObject(NSPanel_Path + 'Config.locale') == false) {
// en-US, de-DE, nl-NL, da-DK, es-ES, fr-FR, it-IT, ru-RU, etc. // en-US, de-DE, nl-NL, da-DK, es-ES, fr-FR, it-IT, ru-RU, etc.
await createStateAsync(NSPanel_Path + 'Config.locale', 'de-DE', { type: 'string' }); await createStateAsync(NSPanel_Path + 'Config.locale', 'de-DE', { type: 'string', write: true });
setStateAsync(NSPanel_Path + 'Config.locale', 'de-DE'); setStateAsync(NSPanel_Path + 'Config.locale', 'de-DE');
} }
if (existsObject(NSPanel_Path + 'Config.temperatureUnit') == false) { if (existsObject(NSPanel_Path + 'Config.temperatureUnit') == false) {
// '°C', '°F', 'K' // '°C', '°F', 'K'
await createStateAsync(NSPanel_Path + 'Config.temperatureUnit', '°C', { type: 'string' }); await createStateAsync(NSPanel_Path + 'Config.temperatureUnit', '°C', { type: 'string', write: true });
} }
// locale Tastensensor popupInSel buttonSensor // locale Tastensensor popupInSel buttonSensor
if (existsObject(NSPanel_Path + 'Config.localeNumber') == false) { if (existsObject(NSPanel_Path + 'Config.localeNumber') == false) {
await createStateAsync(NSPanel_Path + 'Config.localeNumber', 1, { type: 'number' }); await createStateAsync(NSPanel_Path + 'Config.localeNumber', 1, { type: 'number', write: true });
setObject(AliasPath + 'Config.localeNumber', {type: 'channel', common: {role: 'buttonSensor', name:'localeNumber'}, native: {}}); setObject(AliasPath + 'Config.localeNumber', {type: 'channel', common: {role: 'buttonSensor', name:'localeNumber'}, native: {}});
await createAliasAsync(AliasPath + 'Config.localeNumber.VALUE', NSPanel_Path + 'Config.localeNumber', true, <iobJS.StateCommon>{ type: 'number', role: 'state', name: 'VALUE' }); await createAliasAsync(AliasPath + 'Config.localeNumber.VALUE', NSPanel_Path + 'Config.localeNumber', true, <iobJS.StateCommon>{ type: 'number', role: 'state', name: 'VALUE' });
} }
// temperatureUnit popupInSel buttonSensor // temperatureUnit popupInSel buttonSensor
if (existsObject(NSPanel_Path + 'Config.temperatureUnitNumber') == false) { if (existsObject(NSPanel_Path + 'Config.temperatureUnitNumber') == false) {
await createStateAsync(NSPanel_Path + 'Config.temperatureUnitNumber', 0, { type: 'number' }); await createStateAsync(NSPanel_Path + 'Config.temperatureUnitNumber', 0, { type: 'number', write: true });
setObject(AliasPath + 'Config.temperatureUnitNumber', {type: 'channel', common: {role: 'buttonSensor', name:'temperatureUnitNumber'}, native: {}}); setObject(AliasPath + 'Config.temperatureUnitNumber', {type: 'channel', common: {role: 'buttonSensor', name:'temperatureUnitNumber'}, native: {}});
await createAliasAsync(AliasPath + 'Config.temperatureUnitNumber.VALUE', NSPanel_Path + 'Config.temperatureUnitNumber', true, <iobJS.StateCommon>{ type: 'number', role: 'state', name: 'VALUE' }); await createAliasAsync(AliasPath + 'Config.temperatureUnitNumber.VALUE', NSPanel_Path + 'Config.temperatureUnitNumber', true, <iobJS.StateCommon>{ type: 'number', role: 'state', name: 'VALUE' });
} }
@@ -1352,7 +1362,7 @@ on({id: [NSPanel_Path + 'Config.localeNumber',
async function Init_ScreensaverAdvanced() { async function Init_ScreensaverAdvanced() {
try { try {
if (existsState(NSPanel_Path + 'Config.Screensaver.ScreensaverAdvanced') == false ) { if (existsState(NSPanel_Path + 'Config.Screensaver.ScreensaverAdvanced') == false ) {
await createStateAsync(NSPanel_Path + 'Config.Screensaver.ScreensaverAdvanced', false, true, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.Screensaver.ScreensaverAdvanced', false, true, { type: 'boolean', write: true });
} }
} catch (err: any) { } catch (err: any) {
log('error at function Init_ScreensaverAdvanced: ' + err.message, 'warn'); log('error at function Init_ScreensaverAdvanced: ' + err.message, 'warn');
@@ -1370,13 +1380,13 @@ function CheckEnableSetObject() {
async function Init_ActivePageData() { async function Init_ActivePageData() {
try { try {
if (existsState(NSPanel_Path + 'ActivePage.heading') == false ) { if (existsState(NSPanel_Path + 'ActivePage.heading') == false ) {
await createStateAsync(NSPanel_Path + 'ActivePage.heading', '', true, { type: 'string' }); await createStateAsync(NSPanel_Path + 'ActivePage.heading', '', true, { type: 'string', write: false });
} }
if (existsState(NSPanel_Path + 'ActivePage.type') == false ) { if (existsState(NSPanel_Path + 'ActivePage.type') == false ) {
await createStateAsync(NSPanel_Path + 'ActivePage.type', '', true, { type: 'string' }); await createStateAsync(NSPanel_Path + 'ActivePage.type', '', true, { type: 'string', write: false });
} }
if (existsState(NSPanel_Path + 'ActivePage.id0') == false ) { if (existsState(NSPanel_Path + 'ActivePage.id0') == false ) {
await createStateAsync(NSPanel_Path + 'ActivePage.id0', '', true, { type: 'string' }); await createStateAsync(NSPanel_Path + 'ActivePage.id0', '', true, { type: 'string', write: false });
} }
} catch (err: any) { } catch (err: any) {
log('error at function Init_ActivePageData: ' + err.message, 'warn'); log('error at function Init_ActivePageData: ' + err.message, 'warn');
@@ -1387,8 +1397,27 @@ Init_ActivePageData();
//switch BackgroundColors for Screensaver Indicators //switch BackgroundColors for Screensaver Indicators
async function Init_Screensaver_Backckground_Color_Switch() { async function Init_Screensaver_Backckground_Color_Switch() {
try { try {
if (existsState(NSPanel_Path + 'ScreensaverInfo.bgColorIndicator') == false ) { const objDef: iobJS.StateObject = {
await createStateAsync(NSPanel_Path + 'ScreensaverInfo.bgColorIndicator', 0, true, { type: 'number' }); _id: '',
type: "state",
common: {
type: "number",
name: "Color Indicator",
role: "level",
states: {0:'black', 1:'red', 2:'green', 3:'attention', 4: 'pink', 5: 'dark red'},
read: true,
write: true
},
"native": {},
};
await extendObjectAsync(NSPanel_Path + 'ScreensaverInfo.bgColorIndicator', objDef)
if (await existsStateAsync(NSPanel_Path + 'ScreensaverInfo.bgColorIndicator')) {
const obj = await getStateAsync(NSPanel_Path + 'ScreensaverInfo.bgColorIndicator');
if (obj && obj.val !== null && obj.val !== undefined) {
bgColorScrSaver = obj.val;
} else {
setStateAsync(NSPanel_Path + 'ScreensaverInfo.bgColorIndicator', bgColorScrSaver)
}
} }
} catch (err: any) { } catch (err: any) {
log('error at function Init_Screensaver_Backckground_Color_Switch: ' + err.message, 'warn'); log('error at function Init_Screensaver_Backckground_Color_Switch: ' + err.message, 'warn');
@@ -1432,7 +1461,7 @@ async function Init_bExit_Page_Change() {
alwaysOn = false; alwaysOn = false;
pageCounter = 0; pageCounter = 0;
if (existsState(NSPanel_Path + 'ScreensaverInfo.bExitPage') == false ) { if (existsState(NSPanel_Path + 'ScreensaverInfo.bExitPage') == false ) {
await createStateAsync(NSPanel_Path + 'ScreensaverInfo.bExitPage', -1, true, { type: 'number' }); await createStateAsync(NSPanel_Path + 'ScreensaverInfo.bExitPage', -1, true, { type: 'number', write: true });
} }
} catch (err: any) { } catch (err: any) {
log('error at function Init_bExit_Page_Change: ' + err.message, 'warn'); log('error at function Init_bExit_Page_Change: ' + err.message, 'warn');
@@ -1444,7 +1473,7 @@ Init_bExit_Page_Change();
async function Init_Dimmode_Trigger() { async function Init_Dimmode_Trigger() {
try { try {
if (existsState(NSPanel_Path + 'ScreensaverInfo.Trigger_Dimmode') == false ) { if (existsState(NSPanel_Path + 'ScreensaverInfo.Trigger_Dimmode') == false ) {
await createStateAsync(NSPanel_Path + 'ScreensaverInfo.Trigger_Dimmode', false, true, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'ScreensaverInfo.Trigger_Dimmode', false, true, { type: 'boolean', write: true });
} }
} catch (err: any) { } catch (err: any) {
log('error at function Init_Dimmode_Trigger: ' + err.message, 'warn'); log('error at function Init_Dimmode_Trigger: ' + err.message, 'warn');
@@ -1457,8 +1486,8 @@ async function InitActiveBrightness() {
if (isSetOptionActive) { if (isSetOptionActive) {
if (existsState(NSPanel_Path + 'ScreensaverInfo.activeBrightness') == false || if (existsState(NSPanel_Path + 'ScreensaverInfo.activeBrightness') == false ||
existsState(NSPanel_Path + 'ScreensaverInfo.activeDimmodeBrightness') == false) { existsState(NSPanel_Path + 'ScreensaverInfo.activeDimmodeBrightness') == false) {
await createStateAsync(NSPanel_Path + 'ScreensaverInfo.activeBrightness', 100, { type: 'number' }); await createStateAsync(NSPanel_Path + 'ScreensaverInfo.activeBrightness', 100, { type: 'number', write: true });
await createStateAsync(NSPanel_Path + 'ScreensaverInfo.activeDimmodeBrightness', -1, { type: 'number' }); await createStateAsync(NSPanel_Path + 'ScreensaverInfo.activeDimmodeBrightness', -1, { type: 'number', write: true });
} }
//Create Alias activeBrightness //Create Alias activeBrightness
setObject(AliasPath + 'ScreensaverInfo.activeBrightness', {type: 'channel', common: {role: 'slider', name:'activeBrightness'}, native: {}}); setObject(AliasPath + 'ScreensaverInfo.activeBrightness', {type: 'channel', common: {role: 'slider', name:'activeBrightness'}, native: {}});
@@ -1471,6 +1500,19 @@ async function InitActiveBrightness() {
} }
InitActiveBrightness(); InitActiveBrightness();
on({id: [NSPanel_Path + 'ScreensaverInfo.activeBrightness'], change: 'ne'}, async function (obj) {
try {
let active = getState(NSPanel_Path + 'ScreensaverInfo.activeDimmodeBrightness').val;
if (obj.state.val >= 0 || obj.state.val <= 100) {
log('action at trigger activeBrightness: ' + obj.state.val + ' - activeDimmodeBrightness: ' + active, 'info');
SendToPanel({ payload: 'dimmode~' + active + '~' + obj.state.val + '~' + rgb_dec565(config.defaultBackgroundColor) + '~' + rgb_dec565(globalTextColor) + '~' + Sliders2 });
InitDimmode();
}
} catch (err:any) {
log('error at trigger activeBrightness: ' + err.message, 'warn');
}
});
on({id: [NSPanel_Path + 'ScreensaverInfo.activeDimmodeBrightness'], change: "ne"}, async function (obj) { on({id: [NSPanel_Path + 'ScreensaverInfo.activeDimmodeBrightness'], change: "ne"}, async function (obj) {
try { try {
let active = getState(NSPanel_Path + 'ScreensaverInfo.activeBrightness').val; let active = getState(NSPanel_Path + 'ScreensaverInfo.activeBrightness').val;
@@ -1517,7 +1559,7 @@ on({id: String(NSPanel_Path) + 'ScreensaverInfo.Trigger_Dimmode', change: "ne"},
async function InitRebootPanel() { async function InitRebootPanel() {
try { try {
if (existsState(NSPanel_Path + 'Config.rebootNSPanel') == false) { if (existsState(NSPanel_Path + 'Config.rebootNSPanel') == false) {
await createStateAsync(NSPanel_Path + 'Config.rebootNSPanel', false, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.rebootNSPanel', false, { type: 'boolean', write: true });
setObject(AliasPath + 'Config.rebootNSPanel', {type: 'channel', common: {role: 'button', name:'Reboot NSPanel'}, native: {}}); setObject(AliasPath + 'Config.rebootNSPanel', {type: 'channel', common: {role: 'button', name:'Reboot NSPanel'}, native: {}});
await createAliasAsync(AliasPath + 'Config.rebootNSPanel.SET', NSPanel_Path + 'Config.rebootNSPanel', true, <iobJS.StateCommon>{ type: 'boolean', role: 'state', name: 'SET' }); await createAliasAsync(AliasPath + 'Config.rebootNSPanel.SET', NSPanel_Path + 'Config.rebootNSPanel', true, <iobJS.StateCommon>{ type: 'boolean', role: 'state', name: 'SET' });
} }
@@ -1566,9 +1608,9 @@ async function InitUpdateDatapoints() {
try { try {
if (existsState(NSPanel_Path + 'Config.Update.UpdateTasmota') == false) { if (existsState(NSPanel_Path + 'Config.Update.UpdateTasmota') == false) {
if (isSetOptionActive) { if (isSetOptionActive) {
await createStateAsync(NSPanel_Path + 'Config.Update.UpdateTasmota', false, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.Update.UpdateTasmota', false, { type: 'boolean', write: true });
await createStateAsync(NSPanel_Path + 'Config.Update.UpdateBerry', false, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.Update.UpdateBerry', false, { type: 'boolean', write: true });
await createStateAsync(NSPanel_Path + 'Config.Update.UpdateNextion', false, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.Update.UpdateNextion', false, { type: 'boolean', write: true });
setObject(AliasPath + 'Config.Update.UpdateTasmota', {type: 'channel', common: {role: 'button', name:'Tassmota update'}, native: {}}); setObject(AliasPath + 'Config.Update.UpdateTasmota', {type: 'channel', common: {role: 'button', name:'Tassmota update'}, native: {}});
setObject(AliasPath + 'Config.Update.UpdateBerry', {type: 'channel', common: {role: 'button', name:'Berry-Driver update'}, native: {}}); setObject(AliasPath + 'Config.Update.UpdateBerry', {type: 'channel', common: {role: 'button', name:'Berry-Driver update'}, native: {}});
setObject(AliasPath + 'Config.Update.UpdateNextion', {type: 'channel', common: {role: 'button', name:'Nextion TFT update'}, native: {}}); setObject(AliasPath + 'Config.Update.UpdateNextion', {type: 'channel', common: {role: 'button', name:'Nextion TFT update'}, native: {}});
@@ -1612,8 +1654,8 @@ async function Init_Relays() {
if (isSetOptionActive) { if (isSetOptionActive) {
if (existsState(NSPanel_Path + 'Relay.1') == false || if (existsState(NSPanel_Path + 'Relay.1') == false ||
existsState(NSPanel_Path + 'Relay.2') == false) { existsState(NSPanel_Path + 'Relay.2') == false) {
await createStateAsync(NSPanel_Path + 'Relay.1', true, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Relay.1', true, { type: 'boolean', write: true });
await createStateAsync(NSPanel_Path + 'Relay.2', true, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Relay.2', true, { type: 'boolean', write: true });
} }
setObject(AliasPath + 'Relay.1', {type: 'channel', common: {role: 'socket', name:'Relay.1'}, native: {}}); setObject(AliasPath + 'Relay.1', {type: 'channel', common: {role: 'socket', name:'Relay.1'}, native: {}});
await createAliasAsync(AliasPath + 'Relay.1.ACTUAL', NSPanel_Path + 'Relay.1', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Relay.1.ACTUAL', NSPanel_Path + 'Relay.1', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' });
@@ -1635,8 +1677,8 @@ async function InitAlternateMRIconsSize() {
if (isSetOptionActive) { if (isSetOptionActive) {
if (existsState(NSPanel_Path + 'Config.MRIcons.alternateMRIconSize.1') == false || if (existsState(NSPanel_Path + 'Config.MRIcons.alternateMRIconSize.1') == false ||
existsState(NSPanel_Path + 'Config.MRIcons.alternateMRIconSize.2') == false) { existsState(NSPanel_Path + 'Config.MRIcons.alternateMRIconSize.2') == false) {
await createStateAsync(NSPanel_Path + 'Config.MRIcons.alternateMRIconSize.1', false, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.MRIcons.alternateMRIconSize.1', false, { type: 'boolean', write: true });
await createStateAsync(NSPanel_Path + 'Config.MRIcons.alternateMRIconSize.2', false, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.MRIcons.alternateMRIconSize.2', false, { type: 'boolean', write: true });
} }
//Create Alias alternateMRIconSize 1 //Create Alias alternateMRIconSize 1
setObject(AliasPath + 'Config.MRIcons.alternateMRIconSize.1', {type: 'channel', common: {role: 'socket', name:'alternateMRIconSize.1'}, native: {}}); setObject(AliasPath + 'Config.MRIcons.alternateMRIconSize.1', {type: 'channel', common: {role: 'socket', name:'alternateMRIconSize.1'}, native: {}});
@@ -1660,14 +1702,14 @@ async function InitDateformat() {
if (existsState(NSPanel_Path + 'Config.Dateformat.weekday') == false || if (existsState(NSPanel_Path + 'Config.Dateformat.weekday') == false ||
existsState(NSPanel_Path + 'Config.Dateformat.month') == false || existsState(NSPanel_Path + 'Config.Dateformat.month') == false ||
existsState(NSPanel_Path + 'Config.Dateformat.customFormat') == false) { existsState(NSPanel_Path + 'Config.Dateformat.customFormat') == false) {
await createStateAsync(NSPanel_Path + 'Config.Dateformat.weekday', 'long', { type: 'string' }); await createStateAsync(NSPanel_Path + 'Config.Dateformat.weekday', 'long', { type: 'string', write: true });
await createStateAsync(NSPanel_Path + 'Config.Dateformat.month', 'long', { type: 'string' }); await createStateAsync(NSPanel_Path + 'Config.Dateformat.month', 'long', { type: 'string', write: true });
await createStateAsync(NSPanel_Path + 'Config.Dateformat.customFormat', '', { type: 'string' }); await createStateAsync(NSPanel_Path + 'Config.Dateformat.customFormat', '', { type: 'string', write: true });
} }
if (existsState(NSPanel_Path + 'Config.Dateformat.Switch.weekday') == false || if (existsState(NSPanel_Path + 'Config.Dateformat.Switch.weekday') == false ||
existsState(NSPanel_Path + 'Config.Dateformat.Switch.month') == false) { existsState(NSPanel_Path + 'Config.Dateformat.Switch.month') == false) {
await createStateAsync(NSPanel_Path + 'Config.Dateformat.Switch.weekday', true, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.Dateformat.Switch.weekday', true, { type: 'boolean', write: true });
await createStateAsync(NSPanel_Path + 'Config.Dateformat.Switch.month', true, { type: 'boolean' }); await createStateAsync(NSPanel_Path + 'Config.Dateformat.Switch.month', true, { type: 'boolean', write: true });
setObject(AliasPath + 'Config.Dateformat.Switch.weekday', {type: 'channel', common: {role: 'socket', name:'Dateformat Switch weekday'}, native: {}}); setObject(AliasPath + 'Config.Dateformat.Switch.weekday', {type: 'channel', common: {role: 'socket', name:'Dateformat Switch weekday'}, native: {}});
await createAliasAsync(AliasPath + 'Config.Dateformat.Switch.weekday.ACTUAL', NSPanel_Path + 'Config.Dateformat.Switch.weekday', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Config.Dateformat.Switch.weekday.ACTUAL', NSPanel_Path + 'Config.Dateformat.Switch.weekday', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'Config.Dateformat.Switch.weekday.SET', NSPanel_Path + 'Config.Dateformat.Switch.weekday', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' }); await createAliasAsync(AliasPath + 'Config.Dateformat.Switch.weekday.SET', NSPanel_Path + 'Config.Dateformat.Switch.weekday', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' });
@@ -1704,8 +1746,19 @@ on({id: [String(NSPanel_Path) + 'Config.Dateformat.Switch.weekday',
} }
}); });
//Set Relays from Tasmota
const NSPanelStatTopic = NSPanelSendTopic.replace('.cmnd.','.stat.').replace(/\.CustomSend$/g,'.');
on({id: [String(NSPanelStatTopic) + 'POWER1',String(NSPanelStatTopic) + 'POWER2'], change: "ne"}, (obj) => {
if (!obj || !obj.id) return
const n = obj.id.substring(obj.id.length-1);
if ( n === '1' || n === '2') {
if (getState(NSPanel_Path + 'Relay.' + n).val != obj.state.val) {
setState(NSPanel_Path + 'Relay.' + n, obj.state.val == 'ON' ? true : false, true);
}
}
})
//Control Relays from DP's //Control Relays from DP's
on({id: [String(NSPanel_Path) + 'Relay.1',String(NSPanel_Path) + 'Relay.2'], change: "ne"}, async function (obj) { on({id: [String(NSPanel_Path) + 'Relay.1',String(NSPanel_Path) + 'Relay.2'], change: "ne", ack: false}, async function (obj) {
try { try {
let Button = obj.id!.split('.'); let Button = obj.id!.split('.');
let urlString: string = ['http://',get_current_tasmota_ip_address(),'/cm?cmnd=Power',Button[Button.length - 1],' ',(obj.state ? obj.state.val : "")].join(''); let urlString: string = ['http://',get_current_tasmota_ip_address(),'/cm?cmnd=Power',Button[Button.length - 1],' ',(obj.state ? obj.state.val : "")].join('');
@@ -1811,7 +1864,7 @@ CreateWeatherAlias();
async function InitPageNavi() { async function InitPageNavi() {
try { try {
if (!existsState(NSPanel_Path + 'PageNavi')) { if (!existsState(NSPanel_Path + 'PageNavi')) {
await createStateAsync(NSPanel_Path + 'PageNavi', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'PageNavi', <iobJS.StateCommon>{ type: 'string', write: true });
await setStateAsync(NSPanel_Path + 'PageNavi', <iobJS.State>{ val: {"pagetype": "page","pageId": 0}, ack: true }); await setStateAsync(NSPanel_Path + 'PageNavi', <iobJS.State>{ val: {"pagetype": "page","pageId": 0}, ack: true });
} }
} catch (err: any) { } catch (err: any) {
@@ -1874,9 +1927,9 @@ async function InitWeatherForecast() {
if (existsState(NSPanel_Path + "ScreensaverInfo.weatherForecast") == false || if (existsState(NSPanel_Path + "ScreensaverInfo.weatherForecast") == false ||
existsState(NSPanel_Path + "ScreensaverInfo.weatherForecastTimer") == false || existsState(NSPanel_Path + "ScreensaverInfo.weatherForecastTimer") == false ||
existsState(NSPanel_Path + "ScreensaverInfo.entityChangeTime") == false) { existsState(NSPanel_Path + "ScreensaverInfo.entityChangeTime") == false) {
await createStateAsync(NSPanel_Path + "ScreensaverInfo.weatherForecast", true, { type: 'boolean' }); await createStateAsync(NSPanel_Path + "ScreensaverInfo.weatherForecast", true, { type: 'boolean', write: true });
await createStateAsync(NSPanel_Path + "ScreensaverInfo.weatherForecastTimer", true, { type: 'boolean' }); await createStateAsync(NSPanel_Path + "ScreensaverInfo.weatherForecastTimer", true, { type: 'boolean', write: true });
await createStateAsync(NSPanel_Path + "ScreensaverInfo.entityChangeTime", 60, { type: 'number' }); await createStateAsync(NSPanel_Path + "ScreensaverInfo.entityChangeTime", 60, { type: 'number', write: true });
} }
//Create Alias weatherForecast //Create Alias weatherForecast
setObject(AliasPath + 'ScreensaverInfo.weatherForecast', {type: 'channel', common: {role: 'socket', name:'weatherForecast'}, native: {}}); setObject(AliasPath + 'ScreensaverInfo.weatherForecast', {type: 'channel', common: {role: 'socket', name:'weatherForecast'}, native: {}});
@@ -1902,28 +1955,28 @@ async function InitDimmode() {
if (isSetOptionActive) { if (isSetOptionActive) {
// Screensaver on dark at night ("brightnessNight: e.g. 2") or off ("brightnessNight:0") // Screensaver on dark at night ("brightnessNight: e.g. 2") or off ("brightnessNight:0")
if (!existsState(NSPanel_Path + 'NSPanel_Dimmode_brightnessDay')) { if (!existsState(NSPanel_Path + 'NSPanel_Dimmode_brightnessDay')) {
await createStateAsync(NSPanel_Path + 'NSPanel_Dimmode_brightnessDay', <iobJS.StateCommon>{ type: 'number' }); await createStateAsync(NSPanel_Path + 'NSPanel_Dimmode_brightnessDay', <iobJS.StateCommon>{ type: 'number', write: true });
await setStateAsync(NSPanel_Path + 'NSPanel_Dimmode_brightnessDay', <iobJS.State>{ val: 8, ack: true }); await setStateAsync(NSPanel_Path + 'NSPanel_Dimmode_brightnessDay', <iobJS.State>{ val: 8, ack: true });
setObject(AliasPath + 'Dimmode.brightnessDay', {type: 'channel', common: {role: 'slider', name:'brightnessDay'}, native: {}}); setObject(AliasPath + 'Dimmode.brightnessDay', {type: 'channel', common: {role: 'slider', name:'brightnessDay'}, native: {}});
await createAliasAsync(AliasPath + 'Dimmode.brightnessDay.ACTUAL', NSPanel_Path + 'NSPanel_Dimmode_brightnessDay', true, <iobJS.StateCommon>{ type: 'number', role: 'value', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Dimmode.brightnessDay.ACTUAL', NSPanel_Path + 'NSPanel_Dimmode_brightnessDay', true, <iobJS.StateCommon>{ type: 'number', role: 'value', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'Dimmode.brightnessDay.SET', NSPanel_Path + 'NSPanel_Dimmode_brightnessDay', true, <iobJS.StateCommon>{ type: 'number', role: 'level', name: 'SET' }); await createAliasAsync(AliasPath + 'Dimmode.brightnessDay.SET', NSPanel_Path + 'NSPanel_Dimmode_brightnessDay', true, <iobJS.StateCommon>{ type: 'number', role: 'level', name: 'SET' });
} }
if (!existsState(NSPanel_Path + 'NSPanel_Dimmode_hourDay')) { if (!existsState(NSPanel_Path + 'NSPanel_Dimmode_hourDay')) {
await createStateAsync(NSPanel_Path + 'NSPanel_Dimmode_hourDay', <iobJS.StateCommon>{ type: 'number' }); await createStateAsync(NSPanel_Path + 'NSPanel_Dimmode_hourDay', <iobJS.StateCommon>{ type: 'number', write: true });
await setStateAsync(NSPanel_Path + 'NSPanel_Dimmode_hourDay', <iobJS.State>{ val: 7, ack: true }); await setStateAsync(NSPanel_Path + 'NSPanel_Dimmode_hourDay', <iobJS.State>{ val: 7, ack: true });
setObject(AliasPath + 'Dimmode.hourDay', {type: 'channel', common: {role: 'slider', name:'hourDay'}, native: {}}); setObject(AliasPath + 'Dimmode.hourDay', {type: 'channel', common: {role: 'slider', name:'hourDay'}, native: {}});
await createAliasAsync(AliasPath + 'Dimmode.hourDay.ACTUAL', NSPanel_Path + 'NSPanel_Dimmode_hourDay', true, <iobJS.StateCommon>{ type: 'number', role: 'value', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Dimmode.hourDay.ACTUAL', NSPanel_Path + 'NSPanel_Dimmode_hourDay', true, <iobJS.StateCommon>{ type: 'number', role: 'value', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'Dimmode.hourDay.SET', NSPanel_Path + 'NSPanel_Dimmode_hourDay', true, <iobJS.StateCommon>{ type: 'number', role: 'level', name: 'SET' }); await createAliasAsync(AliasPath + 'Dimmode.hourDay.SET', NSPanel_Path + 'NSPanel_Dimmode_hourDay', true, <iobJS.StateCommon>{ type: 'number', role: 'level', name: 'SET' });
} }
if (!existsState(NSPanel_Path + 'NSPanel_Dimmode_brightnessNight')) { if (!existsState(NSPanel_Path + 'NSPanel_Dimmode_brightnessNight')) {
await createStateAsync(NSPanel_Path + 'NSPanel_Dimmode_brightnessNight', <iobJS.StateCommon>{ type: 'number' }); await createStateAsync(NSPanel_Path + 'NSPanel_Dimmode_brightnessNight', <iobJS.StateCommon>{ type: 'number', write: true });
await setStateAsync(NSPanel_Path + 'NSPanel_Dimmode_brightnessNight', <iobJS.State>{ val: 1, ack: true }); await setStateAsync(NSPanel_Path + 'NSPanel_Dimmode_brightnessNight', <iobJS.State>{ val: 1, ack: true });
setObject(AliasPath + 'Dimmode.brightnessNight', {type: 'channel', common: {role: 'slider', name:'brightnessNight'}, native: {}}); setObject(AliasPath + 'Dimmode.brightnessNight', {type: 'channel', common: {role: 'slider', name:'brightnessNight'}, native: {}});
await createAliasAsync(AliasPath + 'Dimmode.brightnessNight.ACTUAL', NSPanel_Path + 'NSPanel_Dimmode_brightnessNight', true, <iobJS.StateCommon>{ type: 'number', role: 'value', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Dimmode.brightnessNight.ACTUAL', NSPanel_Path + 'NSPanel_Dimmode_brightnessNight', true, <iobJS.StateCommon>{ type: 'number', role: 'value', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'Dimmode.brightnessNight.SET', NSPanel_Path + 'NSPanel_Dimmode_brightnessNight', true, <iobJS.StateCommon>{ type: 'number', role: 'level', name: 'SET' }); await createAliasAsync(AliasPath + 'Dimmode.brightnessNight.SET', NSPanel_Path + 'NSPanel_Dimmode_brightnessNight', true, <iobJS.StateCommon>{ type: 'number', role: 'level', name: 'SET' });
} }
if (!existsState(NSPanel_Path + 'NSPanel_Dimmode_hourNight')) { if (!existsState(NSPanel_Path + 'NSPanel_Dimmode_hourNight')) {
await createStateAsync(NSPanel_Path + 'NSPanel_Dimmode_hourNight', <iobJS.StateCommon>{ type: 'number' }); await createStateAsync(NSPanel_Path + 'NSPanel_Dimmode_hourNight', <iobJS.StateCommon>{ type: 'number', write: true });
await setStateAsync(NSPanel_Path + 'NSPanel_Dimmode_hourNight', <iobJS.State>{ val: 22, ack: true }); await setStateAsync(NSPanel_Path + 'NSPanel_Dimmode_hourNight', <iobJS.State>{ val: 22, ack: true });
setObject(AliasPath + 'Dimmode.hourNight', {type: 'channel', common: {role: 'slider', name:'hourNight'}, native: {}}); setObject(AliasPath + 'Dimmode.hourNight', {type: 'channel', common: {role: 'slider', name:'hourNight'}, native: {}});
await createAliasAsync(AliasPath + 'Dimmode.hourNight.ACTUAL', NSPanel_Path + 'NSPanel_Dimmode_hourNight', true, <iobJS.StateCommon>{ type: 'number', role: 'value', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Dimmode.hourNight.ACTUAL', NSPanel_Path + 'NSPanel_Dimmode_hourNight', true, <iobJS.StateCommon>{ type: 'number', role: 'value', name: 'ACTUAL' });
@@ -1939,11 +1992,11 @@ async function InitDimmode() {
timeNight: (vTimeNight < 10) ? `0${vTimeNight}:00` : `${vTimeNight}:00` timeNight: (vTimeNight < 10) ? `0${vTimeNight}:00` : `${vTimeNight}:00`
}; };
// timeDimMode Day // timeDimMode Day
scheduleInitDimModeDay = schedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourDay').val, minute: 0 }, () => { scheduleInitDimModeDay = adapterSchedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourDay').val, minute: 0}, 24 * 60 * 60, () => {
ScreensaverDimmode(timeDimMode); ScreensaverDimmode(timeDimMode);
}); });
// timeDimMode Night // timeDimMode Night
scheduleInitDimModeNight = schedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourNight').val, minute: 0 }, () => { scheduleInitDimModeNight = adapterSchedule({ hour: getState(NSPanel_Path + 'NSPanel_Dimmode_hourNight').val, minute: 0 }, 24 * 60 * 60, () => {
ScreensaverDimmode(timeDimMode); ScreensaverDimmode(timeDimMode);
}); });
if (getState(NSPanel_Path + 'ScreensaverInfo.activeDimmodeBrightness').val != null && getState(NSPanel_Path + 'ScreensaverInfo.activeDimmodeBrightness').val != -1) { if (getState(NSPanel_Path + 'ScreensaverInfo.activeDimmodeBrightness').val != null && getState(NSPanel_Path + 'ScreensaverInfo.activeDimmodeBrightness').val != -1) {
@@ -2020,38 +2073,38 @@ async function InitPopupNotify() {
try { try {
if (!existsState(screensaverNotifyHeading)) { if (!existsState(screensaverNotifyHeading)) {
await createStateAsync(screensaverNotifyHeading, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(screensaverNotifyHeading, <iobJS.StateCommon>{ type: 'string', write: true });
await setStateAsync(screensaverNotifyHeading, <iobJS.State>{ val: '', ack: true }); await setStateAsync(screensaverNotifyHeading, <iobJS.State>{ val: '', ack: true });
} }
if (!existsState(screensaverNotifyText)) { if (!existsState(screensaverNotifyText)) {
await createStateAsync(screensaverNotifyText, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(screensaverNotifyText, <iobJS.StateCommon>{ type: 'string', write: true });
await setStateAsync(screensaverNotifyText, <iobJS.State>{ val: '', ack: true }); await setStateAsync(screensaverNotifyText, <iobJS.State>{ val: '', ack: true });
} }
await createStateAsync(popupNotifyHeading, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(popupNotifyHeading, <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(popupNotifyHeadingColor, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(popupNotifyHeadingColor, <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(popupNotifyText, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(popupNotifyText, <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(popupNotifyTextColor, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(popupNotifyTextColor, <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(popupNotifyInternalName, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(popupNotifyInternalName, <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(popupNotifyButton1Text, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(popupNotifyButton1Text, <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(popupNotifyButton1TextColor, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(popupNotifyButton1TextColor, <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(popupNotifyButton2Text, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(popupNotifyButton2Text, <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(popupNotifyButton2TextColor, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(popupNotifyButton2TextColor, <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(popupNotifySleepTimeout, <iobJS.StateCommon>{ type: 'number' }); await createStateAsync(popupNotifySleepTimeout, <iobJS.StateCommon>{ type: 'number', write: true });
await createStateAsync(popupNotifyAction, <iobJS.StateCommon>{ type: 'boolean' }); await createStateAsync(popupNotifyAction, <iobJS.StateCommon>{ type: 'boolean', write: true });
await createStateAsync(popupNotifyLayout, <iobJS.StateCommon>{ type: 'number' }); await createStateAsync(popupNotifyLayout, <iobJS.StateCommon>{ type: 'number', write: true });
await createStateAsync(popupNotifyFontIdText, <iobJS.StateCommon>{ type: 'number' }); await createStateAsync(popupNotifyFontIdText, <iobJS.StateCommon>{ type: 'number', write: true });
await createStateAsync(popupNotifyIcon, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(popupNotifyIcon, <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(popupNotifyIconColor, <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(popupNotifyIconColor, <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(popupNotifyBuzzer,<iobJS.StateCommon>{type: 'string', def: '0'}); await createStateAsync(popupNotifyBuzzer,<iobJS.StateCommon>{type: 'string', def: '0', write: true});
// Notification to screensaver // Notification to screensaver
on({ id: [screensaverNotifyHeading, screensaverNotifyText], change: 'ne', ack: false }, async (obj) => { on({ id: [screensaverNotifyHeading, screensaverNotifyText], change: 'ne', ack: false }, async (obj) => {
const heading = getState(screensaverNotifyHeading).val; const heading = getState(screensaverNotifyHeading).val;
const text = getState(screensaverNotifyText).val; const text = getState(screensaverNotifyText).val;
if (screensaverEnabled) { if (screensaverEnabled && heading != '' && text != '') {
setIfExists(config.panelSendTopic, `notify~${heading}~${text}`); setIfExists(config.panelSendTopic, `notify~${heading}~${text}`);
} }
@@ -2061,10 +2114,8 @@ async function InitPopupNotify() {
}); });
// popupNotify - Notification to a separate page // popupNotify - Notification to a separate page
//on({ id: [popupNotifyInternalName], change: 'ne' }, async () => {
on({ id: [popupNotifyText], change: 'any' }, async() => { on({ id: [popupNotifyText], change: 'any' }, async() => {
let notification: string; let notification: string;
let v_popupNotifyHeadingColor = (getState(popupNotifyHeadingColor).val != null) ? getState(popupNotifyHeadingColor).val : '65504'// Farbe Headline - gelb 65504 let v_popupNotifyHeadingColor = (getState(popupNotifyHeadingColor).val != null) ? getState(popupNotifyHeadingColor).val : '65504'// Farbe Headline - gelb 65504
@@ -2076,15 +2127,18 @@ async function InitPopupNotify() {
let v_popupNotifyIcon = (getState(popupNotifyIcon).val != null) ? getState(popupNotifyIcon).val : 'alert' let v_popupNotifyIcon = (getState(popupNotifyIcon).val != null) ? getState(popupNotifyIcon).val : 'alert'
let v_popupNotifyBuzzer = (getState(popupNotifyBuzzer).val != null) ? getState(popupNotifyBuzzer).val : '0'; let v_popupNotifyBuzzer = (getState(popupNotifyBuzzer).val != null) ? getState(popupNotifyBuzzer).val : '0';
const heading = getState(popupNotifyHeading).val;
const text = getState(popupNotifyText).val;
notification = 'entityUpdateDetail' + '~' notification = 'entityUpdateDetail' + '~'
+ getState(popupNotifyInternalName).val + '~' + getState(popupNotifyInternalName).val + '~'
+ getState(popupNotifyHeading).val + '~' + heading + '~'
+ v_popupNotifyHeadingColor + '~' + v_popupNotifyHeadingColor + '~'
+ getState(popupNotifyButton1Text).val + '~' + getState(popupNotifyButton1Text).val + '~'
+ v_popupNotifyButton1TextColor + '~' + v_popupNotifyButton1TextColor + '~'
+ getState(popupNotifyButton2Text).val + '~' + getState(popupNotifyButton2Text).val + '~'
+ v_popupNotifyButton2TextColor + '~' + v_popupNotifyButton2TextColor + '~'
+ getState(popupNotifyText).val + '~' + text + '~'
+ v_popupNotifyTextColor + '~' + v_popupNotifyTextColor + '~'
+ getState(popupNotifySleepTimeout).val; + getState(popupNotifySleepTimeout).val;
@@ -2095,8 +2149,10 @@ async function InitPopupNotify() {
+ v_popupNotifyIconColor; + v_popupNotifyIconColor;
} }
setIfExists(config.panelSendTopic, 'pageType~popupNotify'); if (heading != '' && text != '') {
setIfExists(config.panelSendTopic, notification); setIfExists(config.panelSendTopic, 'pageType~popupNotify');
setIfExists(config.panelSendTopic, notification);
}
//------ Tasmota Buzzer ------ //------ Tasmota Buzzer ------
@@ -2142,7 +2198,7 @@ let pageId = 0;
let activePage: PageType | undefined = undefined; let activePage: PageType | undefined = undefined;
//Send time to NSPanel //Send time to NSPanel
let scheduleSendTime = schedule('* * * * *', () => { let scheduleSendTime = adapterSchedule(new Date().setSeconds(0,0), 60, () => {
try { try {
SendTime(); SendTime();
HandleScreensaverUpdate(); HandleScreensaverUpdate();
@@ -2152,7 +2208,7 @@ let scheduleSendTime = schedule('* * * * *', () => {
}); });
//Switch between Screensaver Entities and WeatherForecast //Switch between Screensaver Entities and WeatherForecast
let scheduleSwichScreensaver = schedule('*/' + getState(NSPanel_Path + 'ScreensaverInfo.entityChangeTime').val + ' * * * * *', () => { let scheduleSwichScreensaver = adapterSchedule(undefined, parseInt(getState(NSPanel_Path + 'ScreensaverInfo.entityChangeTime').val), () => {
try { try {
//WeatherForecast true/false Switchover delayed //WeatherForecast true/false Switchover delayed
if (getState(NSPanel_Path + "ScreensaverInfo.popupNotifyHeading").val == '' && getState(NSPanel_Path + "ScreensaverInfo.popupNotifyText").val == '' && getState(NSPanel_Path + "ScreensaverInfo.weatherForecast").val == true && getState(NSPanel_Path + "ScreensaverInfo.weatherForecastTimer").val == true) { if (getState(NSPanel_Path + "ScreensaverInfo.popupNotifyHeading").val == '' && getState(NSPanel_Path + "ScreensaverInfo.popupNotifyText").val == '' && getState(NSPanel_Path + "ScreensaverInfo.weatherForecast").val == true && getState(NSPanel_Path + "ScreensaverInfo.weatherForecastTimer").val == true) {
@@ -2211,17 +2267,17 @@ on({id: [config.weatherEntity + '.TEMP',
} }
}); });
let scheduleSendDate = schedule('0 * * * *', () => { let scheduleSendDate = adapterSchedule((new Date().setMinutes(0,0)),60*60, () => {
SendDate(); SendDate();
}); });
// 3:30 a.m. Perform startup and receive current TFT version // 3:30 a.m. Perform startup and receive current TFT version
let scheduleStartup = schedule({ hour: 3, minute: 30 }, async () => { let scheduleStartup = adapterSchedule({ hour: 3, minute: 30 }, 24*60*60, async () => {
setIfExists(config.panelSendTopic, 'pageType~pageStartup'); setIfExists(config.panelSendTopic, 'pageType~pageStartup');
}); });
// Updates currently compare every 12 hours // Updates currently compare every 12 hours
let scheduleCheckUpdates = schedule('{"time":{"start":"00:00","end":"23:59","mode":"hours","interval":12},"period":{"days":1}}', () => { let scheduleCheckUpdates = adapterSchedule(undefined,60*60*12, () => {
get_tasmota_status0(); get_tasmota_status0();
get_panel_update_data(); get_panel_update_data();
check_updates(); check_updates();
@@ -2270,7 +2326,7 @@ async function get_locales() {
if (Debug) { if (Debug) {
log(JSON.stringify(response.data), 'info'); log(JSON.stringify(response.data), 'info');
} }
await createStateAsync(NSPanel_Path + 'NSPanel_locales_json', <iobJS.StateCommon>{ type: 'string', role: 'json' }); await createStateAsync(NSPanel_Path + 'NSPanel_locales_json', <iobJS.StateCommon>{ type: 'string', role: 'json', write: false });
await setStateAsync(NSPanel_Path + 'NSPanel_locales_json', <iobJS.State>{ val: JSON.stringify(response.data), ack: true }); await setStateAsync(NSPanel_Path + 'NSPanel_locales_json', <iobJS.State>{ val: JSON.stringify(response.data), ack: true });
} else { } else {
log('Axios Status - Requesting locales: ' + response.state, 'warn'); log('Axios Status - Requesting locales: ' + response.state, 'warn');
@@ -2298,7 +2354,7 @@ async function get_locales_servicemenu() {
if (Debug) { if (Debug) {
log(JSON.stringify(response.data), 'info'); log(JSON.stringify(response.data), 'info');
} }
await createStateAsync(NSPanel_Path + 'NSPanel_locales_service_json', <iobJS.StateCommon>{ type: 'string', role: 'json' }); await createStateAsync(NSPanel_Path + 'NSPanel_locales_service_json', <iobJS.StateCommon>{ type: 'string', role: 'json', write: false });
await setStateAsync(NSPanel_Path + 'NSPanel_locales_service_json', <iobJS.State>{ val: JSON.stringify(response.data), ack: true }); await setStateAsync(NSPanel_Path + 'NSPanel_locales_service_json', <iobJS.State>{ val: JSON.stringify(response.data), ack: true });
} else { } else {
log('Axios Status - Requesting locales Service Menu: ' + response.state, 'warn'); log('Axios Status - Requesting locales Service Menu: ' + response.state, 'warn');
@@ -2486,7 +2542,7 @@ async function get_panel_update_data() {
await createAliasAsync(AliasPath + 'autoUpdate.ACTUAL', NSPanel_Path + 'NSPanel_autoUpdate', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'autoUpdate.ACTUAL', NSPanel_Path + 'NSPanel_autoUpdate', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'ACTUAL' });
await createAliasAsync(AliasPath + 'autoUpdate.SET', NSPanel_Path + 'NSPanel_autoUpdate', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' }); await createAliasAsync(AliasPath + 'autoUpdate.SET', NSPanel_Path + 'NSPanel_autoUpdate', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'SET' });
} }
await createStateAsync(NSPanel_Path + 'NSPanel_ipAddress', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'NSPanel_ipAddress', <iobJS.StateCommon>{ type: 'string', write: false });
await setStateAsync(NSPanel_Path + 'NSPanel_ipAddress', <iobJS.State>{ val: get_current_tasmota_ip_address(), ack: true }); await setStateAsync(NSPanel_Path + 'NSPanel_ipAddress', <iobJS.State>{ val: get_current_tasmota_ip_address(), ack: true });
if (autoCreateAlias) { if (autoCreateAlias) {
setObject(AliasPath + 'ipAddress', {type: 'channel', common: {role: 'info', name:'ipAddress'}, native: {}}); setObject(AliasPath + 'ipAddress', {type: 'channel', common: {role: 'info', name:'ipAddress'}, native: {}});
@@ -2536,7 +2592,7 @@ function get_online_tasmota_firmware_version() {
const Tasmota_JSON = JSON.parse(JSON.stringify(response.data));// Write JSON result to variable const Tasmota_JSON = JSON.parse(JSON.stringify(response.data));// Write JSON result to variable
const TasmotaTagName = Tasmota_JSON.tag_name; // Filter JSON by "tag_name" and write to variable const TasmotaTagName = Tasmota_JSON.tag_name; // Filter JSON by "tag_name" and write to variable
const TasmotaVersionOnline = TasmotaTagName.replace(/v/i, ''); // Filter unnecessary "v" from variable and write to release variable const TasmotaVersionOnline = TasmotaTagName.replace(/v/i, ''); // Filter unnecessary "v" from variable and write to release variable
await createStateAsync(NSPanel_Path + 'Tasmota_Firmware.onlineVersion', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Tasmota_Firmware.onlineVersion', <iobJS.StateCommon>{ type: 'string', write: false });
setObject(AliasPath + 'Tasmota_Firmware.onlineVersion', {type: 'channel', common: {role: 'info', name:'onlineVersion'}, native: {}}); setObject(AliasPath + 'Tasmota_Firmware.onlineVersion', {type: 'channel', common: {role: 'info', name:'onlineVersion'}, native: {}});
await createAliasAsync(AliasPath + 'Tasmota_Firmware.onlineVersion.ACTUAL', NSPanel_Path + 'Tasmota_Firmware.onlineVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Tasmota_Firmware.onlineVersion.ACTUAL', NSPanel_Path + 'Tasmota_Firmware.onlineVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' });
await setStateAsync(NSPanel_Path + 'Tasmota_Firmware.onlineVersion', <iobJS.State>{ val: TasmotaVersionOnline, ack: true }); await setStateAsync(NSPanel_Path + 'Tasmota_Firmware.onlineVersion', <iobJS.State>{ val: TasmotaVersionOnline, ack: true });
@@ -2574,7 +2630,7 @@ function get_current_berry_driver_version() {
} }
if (isSetOptionActive) { if (isSetOptionActive) {
const BerryDriverVersionCurrent: string = JSON.parse(JSON.stringify(response.data)).nlui_driver_version; const BerryDriverVersionCurrent: string = JSON.parse(JSON.stringify(response.data)).nlui_driver_version;
await createStateAsync(NSPanel_Path + 'Berry_Driver.currentVersion', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Berry_Driver.currentVersion', <iobJS.StateCommon>{ type: 'string', write: false });
await setStateAsync(NSPanel_Path + 'Berry_Driver.currentVersion', <iobJS.State>{ val: JSON.parse(JSON.stringify(response.data)).nlui_driver_version, ack: true }); await setStateAsync(NSPanel_Path + 'Berry_Driver.currentVersion', <iobJS.State>{ val: JSON.parse(JSON.stringify(response.data)).nlui_driver_version, ack: true });
if (autoCreateAlias) { if (autoCreateAlias) {
setObject(AliasPath + 'Display.BerryDriver', {type: 'channel', common: {role: 'info', name: 'Berry Driver'}, native: {}}); setObject(AliasPath + 'Display.BerryDriver', {type: 'channel', common: {role: 'info', name: 'Berry Driver'}, native: {}});
@@ -2615,18 +2671,18 @@ function get_tasmota_status0() {
log(JSON.stringify(response.data), 'info'); log(JSON.stringify(response.data), 'info');
} }
if (isSetOptionActive) { if (isSetOptionActive) {
await createStateAsync(NSPanel_Path + 'Tasmota_Firmware.currentVersion', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Tasmota_Firmware.currentVersion', <iobJS.StateCommon>{ type: 'string', write: false });
await createStateAsync(NSPanel_Path + 'Tasmota.Uptime', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Tasmota.Uptime', <iobJS.StateCommon>{ type: 'string', write: false });
await createStateAsync(NSPanel_Path + 'Tasmota.Version', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Tasmota.Version', <iobJS.StateCommon>{ type: 'string', write: false });
await createStateAsync(NSPanel_Path + 'Tasmota.Hardware', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Tasmota.Hardware', <iobJS.StateCommon>{ type: 'string', write: false });
await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.AP', <iobJS.StateCommon>{ type: 'number' }); await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.AP', <iobJS.StateCommon>{ type: 'number', write: false });
await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.SSId', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.SSId', <iobJS.StateCommon>{ type: 'string', write: false });
await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.BSSId', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.BSSId', <iobJS.StateCommon>{ type: 'string', write: false });
await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.Channel', <iobJS.StateCommon>{ type: 'number' }); await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.Channel', <iobJS.StateCommon>{ type: 'number', write: false });
await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.Mode', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.Mode', <iobJS.StateCommon>{ type: 'string', write: false });
await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.RSSI', <iobJS.StateCommon>{ type: 'number' }); await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.RSSI', <iobJS.StateCommon>{ type: 'number', write: false });
await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.Signal', <iobJS.StateCommon>{ type: 'number' }); await createStateAsync(NSPanel_Path + 'Tasmota.Wifi.Signal', <iobJS.StateCommon>{ type: 'number', write: false });
await createStateAsync(NSPanel_Path + 'Tasmota.Product', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Tasmota.Product', <iobJS.StateCommon>{ type: 'string', write: false });
try { try {
const Tasmota_JSON = JSON.parse(JSON.stringify(response.data)); const Tasmota_JSON = JSON.parse(JSON.stringify(response.data));
@@ -2706,7 +2762,7 @@ function get_online_berry_driver_version() {
} }
if (isSetOptionActive) { if (isSetOptionActive) {
const BerryDriverVersionOnline = response.data.substring((response.data.indexOf('version_of_this_script = ') + 24), response.data.indexOf('version_of_this_script = ') + 27).replace(/\s+/g, ''); const BerryDriverVersionOnline = response.data.substring((response.data.indexOf('version_of_this_script = ') + 24), response.data.indexOf('version_of_this_script = ') + 27).replace(/\s+/g, '');
await createStateAsync(NSPanel_Path + 'Berry_Driver.onlineVersion', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Berry_Driver.onlineVersion', <iobJS.StateCommon>{ type: 'string', write: false });
setObject(AliasPath + 'Berry_Driver.onlineVersion', {type: 'channel', common: {role: 'info', name:'onlineVersion'}, native: {}}); setObject(AliasPath + 'Berry_Driver.onlineVersion', {type: 'channel', common: {role: 'info', name:'onlineVersion'}, native: {}});
await createAliasAsync(AliasPath + 'Berry_Driver.onlineVersion.ACTUAL', NSPanel_Path + 'Berry_Driver.onlineVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' }); await createAliasAsync(AliasPath + 'Berry_Driver.onlineVersion.ACTUAL', NSPanel_Path + 'Berry_Driver.onlineVersion', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' });
await setStateAsync(NSPanel_Path + 'Berry_Driver.onlineVersion', <iobJS.State>{ val: BerryDriverVersionOnline, ack: true }); await setStateAsync(NSPanel_Path + 'Berry_Driver.onlineVersion', <iobJS.State>{ val: BerryDriverVersionOnline, ack: true });
@@ -2744,7 +2800,7 @@ function check_version_tft_firmware() {
let NSPanelTagName = NSPanel_JSON.tag_name; // created_at; published_at; name ; draft ; prerelease let NSPanelTagName = NSPanel_JSON.tag_name; // created_at; published_at; name ; draft ; prerelease
let NSPanelVersion = NSPanelTagName.replace(/v/i, ''); // Filter unnecessary "v" from variable and write to release variable let NSPanelVersion = NSPanelTagName.replace(/v/i, ''); // Filter unnecessary "v" from variable and write to release variable
await createStateAsync(NSPanel_Path + 'TFT_Firmware.onlineVersion', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'TFT_Firmware.onlineVersion', <iobJS.StateCommon>{ type: 'string', write: false });
await setStateAsync(NSPanel_Path + 'TFT_Firmware.onlineVersion', <iobJS.State>{ val: NSPanelVersion, ack: true }); await setStateAsync(NSPanel_Path + 'TFT_Firmware.onlineVersion', <iobJS.State>{ val: NSPanelVersion, ack: true });
if (Debug) log('online TFT firmware version => ' + NSPanelVersion, 'info'); if (Debug) log('online TFT firmware version => ' + NSPanelVersion, 'info');
} else { } else {
@@ -2776,7 +2832,7 @@ function check_online_display_firmware() {
} }
let desired_display_firmware_version = response.data.substring((response.data.indexOf('desired_display_firmware_version =') + 34), response.data.indexOf('desired_display_firmware_version =') + 38).replace(/\s+/g, ''); let desired_display_firmware_version = response.data.substring((response.data.indexOf('desired_display_firmware_version =') + 34), response.data.indexOf('desired_display_firmware_version =') + 38).replace(/\s+/g, '');
await createStateAsync(NSPanel_Path + 'Display_Firmware.onlineVersion', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Display_Firmware.onlineVersion', <iobJS.StateCommon>{ type: 'string', write: false });
await setStateAsync(NSPanel_Path + 'Display_Firmware.onlineVersion', <iobJS.State>{ val: desired_display_firmware_version, ack: true }); await setStateAsync(NSPanel_Path + 'Display_Firmware.onlineVersion', <iobJS.State>{ val: desired_display_firmware_version, ack: true });
if (Debug) log('online display firmware version => ' + desired_display_firmware_version, 'info'); if (Debug) log('online display firmware version => ' + desired_display_firmware_version, 'info');
} else { } else {
@@ -2801,8 +2857,8 @@ on({ id: config.panelRecvTopic }, async (obj) => {
if (isSetOptionActive) { if (isSetOptionActive) {
if (split[0] == 'event' && split[1] == 'startup') { if (split[0] == 'event' && split[1] == 'startup') {
await createStateAsync(NSPanel_Path + 'Display_Firmware.currentVersion', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Display_Firmware.currentVersion', <iobJS.StateCommon>{ type: 'string', write: false });
await createStateAsync(NSPanel_Path + 'NSPanel_Version', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'NSPanel_Version', <iobJS.StateCommon>{ type: 'string', write: false });
await setStateAsync(NSPanel_Path + 'Display_Firmware.currentVersion', <iobJS.State>{ val: split[2], ack: true }); await setStateAsync(NSPanel_Path + 'Display_Firmware.currentVersion', <iobJS.State>{ val: split[2], ack: true });
await setStateAsync(NSPanel_Path + 'NSPanel_Version', <iobJS.State>{ val: split[3], ack: true }); await setStateAsync(NSPanel_Path + 'NSPanel_Version', <iobJS.State>{ val: split[3], ack: true });
@@ -2880,7 +2936,7 @@ function update_tft_firmware() {
if (Debug) { if (Debug) {
log(response.data, 'info'); log(response.data, 'info');
} }
await createStateAsync(NSPanel_Path + 'TFT_Firmware.onlineVersion', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'TFT_Firmware.onlineVersion', <iobJS.StateCommon>{ type: 'string', write: false });
await setStateAsync(NSPanel_Path + 'TFT_Firmware.onlineVersion', <iobJS.State>{ val: tft_version, ack: true }); await setStateAsync(NSPanel_Path + 'TFT_Firmware.onlineVersion', <iobJS.State>{ val: tft_version, ack: true });
Init_Release(); Init_Release();
} else { } else {
@@ -3330,19 +3386,19 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
// ioBroker // ioBroker
if (pageItem.id && existsObject(pageItem.id) || pageItem.navigate === true) { if (pageItem.id && existsObject(pageItem.id) || pageItem.navigate === true) {
let iconColor = rgb_dec565(config.defaultColor); let iconColor:number = rgb_dec565(config.defaultColor);
let optVal = '0'; let optVal:string = '0';
let val: any = null; let val: any = null;
let o:any let o:any = undefined;
if (pageItem.id != null && existsObject(pageItem.id)) { if (pageItem.id != null && existsObject(pageItem.id)) {
o = getObject(pageItem.id); o = getObject(pageItem.id);
} }
// Fallback if no name is given // Fallback if no name is given
name = pageItem.name !== undefined ? pageItem.name : o.common.name.de == undefined ? o.common.name : o.common.name.de; name = pageItem.name !== undefined ? pageItem.name : o.common.name.de == undefined ? o.common.name : o.common.name.de;
let prefix = pageItem.prefixName !== undefined ? pageItem.prefixName : ''; const prefix = pageItem.prefixName !== undefined ? pageItem.prefixName : '';
let suffix = pageItem.suffixName !== undefined ? pageItem.suffixName : ''; const suffix = pageItem.suffixName !== undefined ? pageItem.suffixName : '';
// If name is used with changing values // If name is used with changing values
if ((name || '').indexOf('getState(') != -1) { if ((name || '').indexOf('getState(') != -1) {
@@ -3350,6 +3406,10 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean =
name = getState(dpName).val; name = getState(dpName).val;
RegisterEntityWatcher(dpName); RegisterEntityWatcher(dpName);
} }
else if ((name || '').split('.').length > 3 && existsState(name)) {
name = getState(name).val;
RegisterEntityWatcher(name);
}
name = prefix + name + suffix; name = prefix + name + suffix;
if (existsState(pageItem.id + '.GET')) { if (existsState(pageItem.id + '.GET')) {
@@ -5074,6 +5134,9 @@ function GenerateMediaPage(page: NSPanel.PageMedia): NSPanel.Payload[] {
vElapsed = vElapsed.slice(1); vElapsed = vElapsed.slice(1);
} }
} }
if (vElapsed == 0) {
vElapsed = '0:00';
}
let vDuration = Duration; let vDuration = Duration;
if (vDuration.length == 5) { if (vDuration.length == 5) {
if(parseInt(vDuration.slice(0,2)) < 9) { if(parseInt(vDuration.slice(0,2)) < 9) {
@@ -5580,11 +5643,11 @@ async function createAutoAlarmAlias (id: string, nsPath: string){
if (autoCreateAlias) { if (autoCreateAlias) {
if (isSetOptionActive) { if (isSetOptionActive) {
if (existsState(nsPath + '.AlarmPin') == false || existsState(nsPath + '.AlarmState') == false || existsState(nsPath + '.AlarmType') == false || existsState(nsPath + '.PIN_Failed') == false || existsState(nsPath + '.PANEL') == false) { if (existsState(nsPath + '.AlarmPin') == false || existsState(nsPath + '.AlarmState') == false || existsState(nsPath + '.AlarmType') == false || existsState(nsPath + '.PIN_Failed') == false || existsState(nsPath + '.PANEL') == false) {
await createStateAsync(nsPath + '.AlarmPin', '0000', { type: 'string' }); await createStateAsync(nsPath + '.AlarmPin', '0000', { type: 'string', write: true });
await createStateAsync(nsPath + '.AlarmState', 'disarmed', { type: 'string' }); await createStateAsync(nsPath + '.AlarmState', 'disarmed', { type: 'string', write: false });
await createStateAsync(nsPath + '.AlarmType', 'D1', { type: 'string' }); await createStateAsync(nsPath + '.AlarmType', 'D1', { type: 'string', write: false });
await createStateAsync(nsPath + '.PIN_Failed', 0, { type: 'number' }); await createStateAsync(nsPath + '.PIN_Failed', 0, { type: 'number', write: false });
await createStateAsync(nsPath + '.PANEL', NSPanel_Path, { type: 'string' }); await createStateAsync(nsPath + '.PANEL', NSPanel_Path, { type: 'string', write: false });
setObject(id, {_id: id, type: 'channel', common: {role: 'sensor.fire.alarm', name:'alarm'}, native: {}}); setObject(id, {_id: id, type: 'channel', common: {role: 'sensor.fire.alarm', name:'alarm'}, native: {}});
await createAliasAsync(id + '.ACTUAL', nsPath + '.AlarmState', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' }); await createAliasAsync(id + '.ACTUAL', nsPath + '.AlarmState', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' });
await createAliasAsync(id + '.PIN', nsPath + '.AlarmPin', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'PIN' }); await createAliasAsync(id + '.PIN', nsPath + '.AlarmPin', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'PIN' });
@@ -5744,8 +5807,8 @@ async function createAutoUnlockAlias(id: string, dpPath: string) {
if (autoCreateAlias) { if (autoCreateAlias) {
if (isSetOptionActive) { if (isSetOptionActive) {
if (existsState(dpPath + 'UnlockPin') == false || existsState(dpPath + 'Access') == false) { if (existsState(dpPath + 'UnlockPin') == false || existsState(dpPath + 'Access') == false) {
await createStateAsync(dpPath + 'UnlockPin', '0000', { type: 'string' }); await createStateAsync(dpPath + 'UnlockPin', '0000', { type: 'string', write: true });
await createStateAsync(dpPath + 'Access', 'false', { type: 'boolean' }); await createStateAsync(dpPath + 'Access', 'false', { type: 'boolean', write: false });
setObject(id, { _id: id, type: 'channel', common: { role: 'sensor.fire.alarm', name: 'sensor.fire.alarm' }, native: {} }); setObject(id, { _id: id, type: 'channel', common: { role: 'sensor.fire.alarm', name: 'sensor.fire.alarm' }, native: {} });
await createAliasAsync(id + '.PIN', dpPath + 'UnlockPin', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'PIN' }); await createAliasAsync(id + '.PIN', dpPath + 'UnlockPin', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'PIN' });
await createAliasAsync(id + '.ACTUAL', dpPath + 'Access', true, <iobJS.StateCommon>{ type: 'boolean', role: 'sensor.fire.alarm', name: 'ACTUAL' }); await createAliasAsync(id + '.ACTUAL', dpPath + 'Access', true, <iobJS.StateCommon>{ type: 'boolean', role: 'sensor.fire.alarm', name: 'ACTUAL' });
@@ -5826,8 +5889,8 @@ async function createAutoQRAlias(id:string, dpPath:string) {
if (autoCreateAlias) { if (autoCreateAlias) {
if (isSetOptionActive) { if (isSetOptionActive) {
if (existsState(dpPath + 'Daten') == false) { if (existsState(dpPath + 'Daten') == false) {
await createStateAsync(dpPath + 'Daten', 'WIFI:T:undefined;S:undefined;P:undefined;H:undefined;', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(dpPath + 'Daten', 'WIFI:T:undefined;S:undefined;P:undefined;H:undefined;', <iobJS.StateCommon>{ type: 'string', write: true });
await createStateAsync(dpPath + 'Switch', false, <iobJS.StateCommon>{ type: 'boolean' }); await createStateAsync(dpPath + 'Switch', false, <iobJS.StateCommon>{ type: 'boolean', write: true });
setObject(id, { _id: id, type: 'channel', common: { role: 'switch.mode.wlan', name: 'QR Page' }, native: {} }); setObject(id, { _id: id, type: 'channel', common: { role: 'switch.mode.wlan', name: 'QR Page' }, native: {} });
await createAliasAsync(id + '.ACTUAL', dpPath + 'Daten', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' }); await createAliasAsync(id + '.ACTUAL', dpPath + 'Daten', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'ACTUAL' });
await createAliasAsync(id + '.SWITCH', dpPath + 'Switch', true, <iobJS.StateCommon>{ type: 'boolean', role: 'state', name: 'SWITCH' }); await createAliasAsync(id + '.SWITCH', dpPath + 'Switch', true, <iobJS.StateCommon>{ type: 'boolean', role: 'state', name: 'SWITCH' });
@@ -6080,6 +6143,7 @@ function GeneratePowerPage(page: NSPanel.PagePower): NSPanel.Payload[] {
} }
} }
const timeValueRegEx = /\~\d+:(\d+)/g;
function GenerateChartPage(page: NSPanel.PageChart): NSPanel.Payload[] { function GenerateChartPage(page: NSPanel.PageChart): NSPanel.Payload[] {
try { try {
activePage = page; activePage = page;
@@ -6090,16 +6154,41 @@ function GenerateChartPage(page: NSPanel.PageChart): NSPanel.Payload[] {
let heading = page.heading !== undefined ? page.heading : "Chart..."; let heading = page.heading !== undefined ? page.heading : "Chart...";
let txt = getState(id + '.ACTUAL').val; const txt = getState(id + '.ACTUAL')?.val;
if (!page.items[0].yAxisTicks) { if (!txt) {
throw new Error (`Page item ${id} yAxisTicks is undefined!`) throw new Error(`Unable to get the state of ${id}.ACTUAL`)
} }
let yAxisTicks : number[] = [];
if (!page.items[0].yAxisTicks) {
const sorted = [...txt.matchAll(timeValueRegEx)].map(x => Number(x[1])).sort((x, y) => x < y ? -1 : 1);
if (sorted.length === 0) {
throw new Error (`Page item ${id} yAxisTicks is undefined and unable to be calculated!`)
}
const minValue = sorted[0];
const maxValue = sorted[sorted.length - 1];
const tick = Math.max(Number(((maxValue - minValue) / 5).toFixed()), 10);
let currentTick = minValue - tick;
while(currentTick < (maxValue + tick)) {
yAxisTicks.push(currentTick);
currentTick += tick;
}
if (Debug) {
log(`Calculated yAxisTicks for ${id} (Min: ${minValue}, Max: ${maxValue}, Tick: ${tick}): ${yAxisTicks}`);
}
} else {
yAxisTicks = typeof page.items[0].yAxisTicks === 'string'
? JSON.parse(getState(page.items[0].yAxisTicks).val)
: page.items[0].yAxisTicks;
}
if (!page.items[0].onColor) { if (!page.items[0].onColor) {
throw new Error (`Page item ${id} onColor is undefined!`) throw new Error (`Page item ${id} onColor is undefined!`)
} }
let yAxisTicks = (typeof page.items[0].yAxisTicks == 'object') ? page.items[0].yAxisTicks : JSON.parse(getState(page.items[0].yAxisTicks).val);
out_msgs.push({ out_msgs.push({
payload: 'entityUpd~' + //entityUpd payload: 'entityUpd~' + //entityUpd
heading + '~' + //heading heading + '~' + //heading
@@ -6112,7 +6201,6 @@ function GenerateChartPage(page: NSPanel.PageChart): NSPanel.Payload[] {
if (Debug) log('GenerateChartPage payload: ' + JSON.stringify(out_msgs), 'info'); if (Debug) log('GenerateChartPage payload: ' + JSON.stringify(out_msgs), 'info');
return out_msgs; return out_msgs;
} catch (err: any) { } catch (err: any) {
log('error at function GenerateChartPage: ' + err.message, 'warn'); log('error at function GenerateChartPage: ' + err.message, 'warn');
return []; return [];
@@ -6204,11 +6292,8 @@ function HandleButtonEvent(words: any): void {
if (words[2] == 'bNext' || words[2] == 'bPrev' || words[2] == 'bUp' || words[2] == 'bHome' || words[2] == 'bSubNext' || words[2] == 'bSubPrev' ) { if (words[2] == 'bNext' || words[2] == 'bPrev' || words[2] == 'bUp' || words[2] == 'bHome' || words[2] == 'bSubNext' || words[2] == 'bSubPrev' ) {
buttonAction = words[2]; buttonAction = words[2];
pageCounter = 0; pageCounter = 0;
// Turn off the display if the alwaysOnDisplay parameter was specified alwaysOn = false;
if (alwaysOn == true) { SendToPanel({ payload: 'timeout~' + getState(NSPanel_Path + 'Config.Screensaver.timeoutScreensaver').val });
alwaysOn = false;
SendToPanel({ payload: 'timeout~' + getState(NSPanel_Path + 'Config.Screensaver.timeoutScreensaver').val });
}
} }
if (Debug) { if (Debug) {
@@ -6311,6 +6396,7 @@ function HandleButtonEvent(words: any): void {
if (existsObject(NSPanel_Path + 'ScreensaverInfo.bExitPage') && getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val != null && getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val != -1) { if (existsObject(NSPanel_Path + 'ScreensaverInfo.bExitPage') && getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val != null && getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val != -1) {
pageId = getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val pageId = getState(NSPanel_Path + 'ScreensaverInfo.bExitPage').val
} }
screensaverEnabled = true; // Activating screensaver also on One-Time click
} }
activePage = config.pages[pageId]; activePage = config.pages[pageId];
} }
@@ -8219,8 +8305,8 @@ function GenerateDetailPage(type: NSPanel.PopupType, optional: NSPanel.mediaOpti
if (existsObject(NSPanel_Path + 'Media.Player.' + lastIndex + '.EQ.activeMode') == false || if (existsObject(NSPanel_Path + 'Media.Player.' + lastIndex + '.EQ.activeMode') == false ||
existsObject(NSPanel_Path + 'Media.Player.' + lastIndex + '.Speaker') == false) { existsObject(NSPanel_Path + 'Media.Player.' + lastIndex + '.Speaker') == false) {
createState(NSPanel_Path + 'Media.Player.' + lastIndex + '.EQ.activeMode', <iobJS.StateCommon> {type: 'string'}); createState(NSPanel_Path + 'Media.Player.' + lastIndex + '.EQ.activeMode', <iobJS.StateCommon> {type: 'string', write: false});
createState(NSPanel_Path + 'Media.Player.' + lastIndex + '.Speaker', <iobJS.StateCommon> {type: 'string'}); createState(NSPanel_Path + 'Media.Player.' + lastIndex + '.Speaker', <iobJS.StateCommon> {type: 'string', write: false});
} }
actualState = '' actualState = ''
@@ -8594,7 +8680,6 @@ function HandleScreensaverUpdate(): void {
//Alternativ Layout bekommt zusätzlichen Status //Alternativ Layout bekommt zusätzlichen Status
if (config.bottomScreensaverEntity[4] && getState(NSPanel_Path + 'Config.Screensaver.alternativeScreensaverLayout').val) { if (config.bottomScreensaverEntity[4] && getState(NSPanel_Path + 'Config.Screensaver.alternativeScreensaverLayout').val) {
log('alternativ');
let val = getState(config.bottomScreensaverEntity[4].ScreensaverEntity).val; let val = getState(config.bottomScreensaverEntity[4].ScreensaverEntity).val;
if (parseFloat(val+"") == val) { if (parseFloat(val+"") == val) {
val = parseFloat(val); val = parseFloat(val);
@@ -9024,6 +9109,10 @@ function HandleScreensaverColors(): void {
scrSvrBGCol = rgb_dec565(scbackgroundInd2); scrSvrBGCol = rgb_dec565(scbackgroundInd2);
} else if (bgColorScrSaver == 3) { } else if (bgColorScrSaver == 3) {
scrSvrBGCol = rgb_dec565(scbackgroundInd3); scrSvrBGCol = rgb_dec565(scbackgroundInd3);
} else if (bgColorScrSaver == 4) {
scrSvrBGCol = rgb_dec565({red:255, green:16, blue:240});
} else if (bgColorScrSaver == 5) {
scrSvrBGCol = rgb_dec565({ red: 100, green: 0, blue: 0 });
} }
let payloadString = 'color' + '~' + let payloadString = 'color' + '~' +
@@ -9406,10 +9495,10 @@ on({ id: config.panelRecvTopic.substring(0, config.panelRecvTopic.length - 'RESU
try { try {
const Tasmota_Sensor = JSON.parse(obj.state.val); const Tasmota_Sensor = JSON.parse(obj.state.val);
await createStateAsync(NSPanel_Path + 'Sensor.Time', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Sensor.Time', <iobJS.StateCommon>{ type: 'string', write: false });
await createStateAsync(NSPanel_Path + 'Sensor.TempUnit', <iobJS.StateCommon>{ type: 'string' }); await createStateAsync(NSPanel_Path + 'Sensor.TempUnit', <iobJS.StateCommon>{ type: 'string', write: false });
await createStateAsync(NSPanel_Path + 'Sensor.ANALOG.Temperature', <iobJS.StateCommon>{ type: 'number', 'unit': '°C' }); await createStateAsync(NSPanel_Path + 'Sensor.ANALOG.Temperature', <iobJS.StateCommon>{ type: 'number', 'unit': '°C', write: false });
await createStateAsync(NSPanel_Path + 'Sensor.ESP32.Temperature', <iobJS.StateCommon>{ type: 'number', 'unit': '°C' }); await createStateAsync(NSPanel_Path + 'Sensor.ESP32.Temperature', <iobJS.StateCommon>{ type: 'number', 'unit': '°C', write: false });
let dateTime: string = Tasmota_Sensor.Time.split('T'); let dateTime: string = Tasmota_Sensor.Time.split('T');
await setStateAsync(NSPanel_Path + 'Sensor.Time', <iobJS.State>{ val: dateTime[0] + '\r\n' + dateTime[1] , ack: true }); await setStateAsync(NSPanel_Path + 'Sensor.Time', <iobJS.State>{ val: dateTime[0] + '\r\n' + dateTime[1] , ack: true });
await setStateAsync(NSPanel_Path + 'Sensor.TempUnit', <iobJS.State>{ val: '°' + Tasmota_Sensor.TempUnit, ack: true }); await setStateAsync(NSPanel_Path + 'Sensor.TempUnit', <iobJS.State>{ val: '°' + Tasmota_Sensor.TempUnit, ack: true });
@@ -9632,6 +9721,48 @@ type PageUnlock = NSPanel.PageUnlock;
type PageAlarm = NSPanel.PageAlarm; type PageAlarm = NSPanel.PageAlarm;
/**
*
* @param time object { hour: number, minutes: number } | number: Time as number in ms
* @param repeatTime in seconds
* @param callback what todo
* @returns
*/
function adapterSchedule(time: {hour?: number, minute?: number} | undefined | number, repeatTime: number, callback: () => void): number|null {
if (typeof callback !== 'function') return null
const ref = Math.random() + 1;
scheduleList[ref] = setTimeout(_schedule, 1, time, ref, repeatTime, callback), true;
return ref;
}
function _schedule(time: {hour?: number, minute?: number} | undefined | number, ref: number, repeatTime: number, callback, init: boolean = false) {
if (!scheduleList[ref]) return;
if (!init) callback();
let targetTime: number;
if ( time === undefined) {
targetTime = new Date().setMilliseconds(0) + repeatTime * 1000;
time = targetTime;
} else if (typeof time === 'number') {
targetTime = time + repeatTime * 1000;
time = targetTime;
} else {
time.hour = time.hour !== undefined ? time.hour : -1;
time.minute = time.minute !== undefined ? time.minute : 0;
targetTime = time.hour !== -1 ? new Date().setHours(time.hour, time.minute, 0, 0) : new Date().setMinutes(time.minute, 0, 0);
if (new Date().getTime() >= targetTime) {
targetTime += repeatTime * 1000;
targetTime = time.hour !== -1 ? new Date(targetTime).setHours(time.hour, time.minute, 0, 0) : new Date(targetTime).setMinutes(time.minute, 0, 0);
}
}
const timeout = targetTime - new Date().getTime();
scheduleList[ref] = setTimeout(_schedule, timeout, time, ref, repeatTime, callback);
}
function _clearSchedule(ref: number): null {
if (scheduleList[ref]) clearTimeout(scheduleList[ref]);
delete scheduleList[ref];
return null;
}
const ArrayPlayerTypeWithMediaDevice = ['alexa2', 'sonos', 'squeezeboxrpc'] as const const ArrayPlayerTypeWithMediaDevice = ['alexa2', 'sonos', 'squeezeboxrpc'] as const
const ArrayPlayerTypeWithOutMediaDevice = ['spotify-premium', 'volumio', 'bosesoundtouch'] as const const ArrayPlayerTypeWithOutMediaDevice = ['spotify-premium', 'volumio', 'bosesoundtouch'] as const
@@ -9844,7 +9975,8 @@ namespace NSPanel {
setThermoAlias?: string[], setThermoAlias?: string[],
setThermoDestTemp2?: string, setThermoDestTemp2?: string,
} & PageBaseItem } & PageBaseItem
// mean string start with getState(' and end with ').val
type getStateID = string;
export type PageBaseItem = { export type PageBaseItem = {
id?: string | null, id?: string | null,
icon?: string, icon?: string,
@@ -9866,7 +9998,7 @@ namespace NSPanel {
stepValue?: number, stepValue?: number,
prefixName?: string, prefixName?: string,
suffixName?: string, suffixName?: string,
name?: string, name?: string | getStateID,
secondRow?: string, secondRow?: string,
buttonText?: string, buttonText?: string,
unit?: string, unit?: string,

File diff suppressed because it is too large Load Diff

View File

@@ -2697,5 +2697,9 @@
"update_message":{ "update_message":{
"en-US":"Update Notifications", "en-US":"Update Notifications",
"de-DE":"Update Mitteilungen" "de-DE":"Update Mitteilungen"
},
"scriptname":{
"en-US":"Script name",
"de-DE":"Skriptname"
} }
} }