mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-17 10:27:00 +01:00
Compare commits
26 Commits
Armilar-pa
...
bd3b8adde6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd3b8adde6 | ||
|
|
4cc8455fff | ||
|
|
943bb93398 | ||
|
|
0a1eb8c2e5 | ||
|
|
bc69af7b6b | ||
|
|
c36202878f | ||
|
|
60f31595d4 | ||
|
|
7194d7f613 | ||
|
|
af02a70600 | ||
|
|
77d8e0607d | ||
|
|
d6d12bc93c | ||
|
|
127671047f | ||
|
|
ead1def4bb | ||
|
|
14e944885f | ||
|
|
a075e0cba8 | ||
|
|
dd14e66f10 | ||
|
|
ce0892b986 | ||
|
|
71b84cc8d3 | ||
|
|
fd3ce243a6 | ||
|
|
aa3e90ef98 | ||
|
|
2621b22ffd | ||
|
|
6460f5f4ff | ||
|
|
e45560c27f | ||
|
|
0c6cd158dd | ||
|
|
f11de05eb3 | ||
|
|
ef47efb9aa |
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@@ -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
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ Using a 6th entity will automatically activate the alternative layout.
|
|||||||
type: 0
|
type: 0
|
||||||
- entity: weather.demo_weather_north
|
- entity: weather.demo_weather_north
|
||||||
type: 1
|
type: 1
|
||||||
|
- entity: weather.demo_weather_north
|
||||||
|
type: 2
|
||||||
- entity: sensor.energy_usage
|
- entity: sensor.energy_usage
|
||||||
- entity: delete
|
- entity: delete
|
||||||
- entity: sensor.indoor_temp
|
- entity: sensor.indoor_temp
|
||||||
|
|||||||
@@ -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.36 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
|
||||||
@@ -93,6 +93,10 @@ ReleaseNotes:
|
|||||||
- 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
|
||||||
|
|
||||||
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 +915,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 +945,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 +963,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.36';
|
||||||
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 +983,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 +1023,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 +1117,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 +1143,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 +1168,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 +1226,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 +1249,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 +1271,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 +1361,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 +1379,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 +1396,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 +1460,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 +1472,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 +1485,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 +1499,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 +1558,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 +1607,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 +1653,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 +1676,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 +1701,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 +1745,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 +1863,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 +1926,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 +1954,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 +1991,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,31 +2072,31 @@ 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) => {
|
||||||
@@ -2142,7 +2194,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 +2204,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 +2263,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 +2322,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 +2350,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 +2538,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 +2588,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 +2626,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 +2667,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 +2758,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 +2796,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 +2828,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 +2853,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 +2932,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 +3382,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 +3402,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 +5130,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 +5639,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 +5803,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 +5885,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' });
|
||||||
@@ -6204,11 +6263,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) {
|
||||||
@@ -8219,8 +8275,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 +8650,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,8 +9079,12 @@ 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' + '~' +
|
||||||
scrSvrBGCol + '~' + //background
|
scrSvrBGCol + '~' + //background
|
||||||
rgb_dec565(sctime) + '~' + //time
|
rgb_dec565(sctime) + '~' + //time
|
||||||
@@ -9406,10 +9465,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 +9691,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 +9945,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 +9968,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
@@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user