|
|
|
@@ -1,6 +1,6 @@
|
|
|
|
/*-----------------------------------------------------------------------
|
|
|
|
/*-----------------------------------------------------------------------
|
|
|
|
TypeScript v5.0.2.1 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @ticaki / @Britzelpuf / @Sternmiere / @ravenS0ne
|
|
|
|
TypeScript v5.0.0.1 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @TT-Tom / @ticaki / @Britzelpuf / @Sternmiere / @ravenS0ne
|
|
|
|
- abgestimmt auf TFT 59 / v5.0.2 / BerryDriver 10 / Tasmota 15.0.1
|
|
|
|
- abgestimmt auf TFT 59 / v5.0.0 / BerryDriver 10 / Tasmota 15.0.1
|
|
|
|
|
|
|
|
|
|
|
|
Projekt:
|
|
|
|
Projekt:
|
|
|
|
https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker
|
|
|
|
https://github.com/joBr99/nspanel-lovelace-ui/tree/main/ioBroker
|
|
|
|
@@ -18,8 +18,6 @@ Achtung: Keine Beispiele mehr im Script. Die Beispiele sind jetzt unter nachfolg
|
|
|
|
|
|
|
|
|
|
|
|
Icons unter: https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html
|
|
|
|
Icons unter: https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html
|
|
|
|
|
|
|
|
|
|
|
|
************************************************************************************************
|
|
|
|
|
|
|
|
Achtung Tasmota 15.1.0 lässt kein FlashNextion zu --> stattdessen v15.0.1 verwenden
|
|
|
|
|
|
|
|
************************************************************************************************
|
|
|
|
************************************************************************************************
|
|
|
|
Achtung Änderung des Sonoff ESP-Temperatursensors
|
|
|
|
Achtung Änderung des Sonoff ESP-Temperatursensors
|
|
|
|
!!! Bitte "SetOption146 1" in der Tasmota-Console ausführen !!!
|
|
|
|
!!! Bitte "SetOption146 1" in der Tasmota-Console ausführen !!!
|
|
|
|
@@ -92,14 +90,12 @@ ReleaseNotes:
|
|
|
|
- 21.08.2025 - v4.9.5.2 Add Bright Sky Weather Adapter
|
|
|
|
- 21.08.2025 - v4.9.5.2 Add Bright Sky Weather Adapter
|
|
|
|
- 05.09.2025 - v5.0.0 TFT 59 / 5.0.0 - EU Changes in cardMedia, popupInSel, card Grid 1, 2, 3
|
|
|
|
- 05.09.2025 - v5.0.0 TFT 59 / 5.0.0 - EU Changes in cardMedia, popupInSel, card Grid 1, 2, 3
|
|
|
|
- 08.09.2025 - v5.0.0 TFT 59 / 5.0.0 - US-L/US-P Changes in cardMedia, popupInSel, card Grid 1, 2, 3
|
|
|
|
- 08.09.2025 - v5.0.0 TFT 59 / 5.0.0 - US-L/US-P Changes in cardMedia, popupInSel, card Grid 1, 2, 3
|
|
|
|
- 19.09.2025 - v5.0.0.2 Remove Startup Scheedule at 3:30am / Small fix
|
|
|
|
|
|
|
|
- 19.10.2025 - v5.0.2.1 TFT 59 / 5.0.2 - EU/US-L/US-P - Fix cardAlarm Icon; Fix Notification in Advanced Screensaver; Fix Dimensions in cardChart/cardLChart
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
***************************************************************************************************************
|
|
|
|
***************************************************************************************************************
|
|
|
|
* DE: Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObject" gesetzt sein! *
|
|
|
|
* DE: Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObject" gesetzt sein! *
|
|
|
|
* EN: In order for the script to create the aliases, “setObject” must be set in the JavaScript instance! *
|
|
|
|
* EN: In order for the script to create the aliases, “setObject” must be set in the JavaScript instance! *
|
|
|
|
***************************************************************************************************************
|
|
|
|
***************************************************************************************************************{
|
|
|
|
|
|
|
|
|
|
|
|
Wenn Rule definiert, dann können die Hardware-Tasten ebenfalls für Seitensteuerung (dann nicht mehr als Relais) genutzt werden
|
|
|
|
Wenn Rule definiert, dann können die Hardware-Tasten ebenfalls für Seitensteuerung (dann nicht mehr als Relais) genutzt werden
|
|
|
|
|
|
|
|
|
|
|
|
@@ -203,10 +199,10 @@ Install/Upgrades in Konsole:
|
|
|
|
Tasmota BerryDriver Install: Backlog UrlFetch https://raw.githubusercontent.com/ticaki/ioBroker.nspanel-lovelace-ui/refs/heads/main/tasmota/berry/10/autoexec.be; Restart 1
|
|
|
|
Tasmota BerryDriver Install: Backlog UrlFetch https://raw.githubusercontent.com/ticaki/ioBroker.nspanel-lovelace-ui/refs/heads/main/tasmota/berry/10/autoexec.be; Restart 1
|
|
|
|
Tasmota BerryDriver Update: Backlog UpdateDriverVersion https://raw.githubusercontent.com/ticaki/ioBroker.nspanel-lovelace-ui/refs/heads/main/tasmota/berry/10/autoexec.be; Restart 1
|
|
|
|
Tasmota BerryDriver Update: Backlog UpdateDriverVersion https://raw.githubusercontent.com/ticaki/ioBroker.nspanel-lovelace-ui/refs/heads/main/tasmota/berry/10/autoexec.be; Restart 1
|
|
|
|
|
|
|
|
|
|
|
|
TFT EU STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-v5.0.2.tft
|
|
|
|
TFT EU STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-v5.0.0.tft
|
|
|
|
|
|
|
|
|
|
|
|
TFT US-L STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-us-l-v5.0.2.tft
|
|
|
|
TFT US-L STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-us-l-v5.0.0.tft
|
|
|
|
TFT US-P STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-us-p-v5.0.2.tft
|
|
|
|
TFT US-P STABLE Version: FlashNextionAdv0 http://nspanel.de/nspanel-us-p-v5.0.0.tft
|
|
|
|
---------------------------------------------------------------------------------------
|
|
|
|
---------------------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
@@ -234,11 +230,10 @@ const tasmota_web_admin_password: string = '';
|
|
|
|
|
|
|
|
|
|
|
|
// DE: Setzen der bevorzugten Tasmota32-Version (für Updates)
|
|
|
|
// DE: Setzen der bevorzugten Tasmota32-Version (für Updates)
|
|
|
|
// EN: Set preferred Tasmota32 version (for updates)
|
|
|
|
// EN: Set preferred Tasmota32 version (for updates)
|
|
|
|
const tasmotaOtaVersion: string = 'tasmota32-nspanel.bin';
|
|
|
|
const tasmotaOtaVersion: string = 'tasmota32-DE.bin';
|
|
|
|
// DE: Es können ebenfalls andere Versionen verwendet werden wie zum Beispiel:
|
|
|
|
// DE: Es können ebenfalls andere Versionen verwendet werden wie zum Beispiel:
|
|
|
|
// EN: 'tasmota32-DE.bin' oder 'tasmota32.bin' oder 'tasmota32-DE.bin' oder etc.
|
|
|
|
// EN: Other versions can also be used, such as:
|
|
|
|
// DE: !!!Anmerkung!!! Seit Tasmota v15.0.X wird der 4Mb PSRAM im ESP32 nur noch in der tasmota32-nspanel.bin verwendet
|
|
|
|
// 'tasmota32-nspanel.bin' or 'tasmota32.bin' or 'tasmota32-DE.bin' or etc.
|
|
|
|
// EN: !!!Note!!! Since Tasmota v15.0.X, the 4Mb PSRAM in the ESP32 is only used in the tasmota32-nspanel.bin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***** 2. Directories in 0_userdata.0... *****/
|
|
|
|
/***** 2. Directories in 0_userdata.0... *****/
|
|
|
|
@@ -288,7 +283,7 @@ const DarkBlue: RGB = {red: 0, green: 0, blue: 136};
|
|
|
|
const Gray: RGB = {red: 136, green: 136, blue: 136};
|
|
|
|
const Gray: RGB = {red: 136, green: 136, blue: 136};
|
|
|
|
const Black: RGB = {red: 0, green: 0, blue: 0};
|
|
|
|
const Black: RGB = {red: 0, green: 0, blue: 0};
|
|
|
|
const Cyan: RGB = {red: 0, green: 255, blue: 255};
|
|
|
|
const Cyan: RGB = {red: 0, green: 255, blue: 255};
|
|
|
|
const Magenta: RGB = {red: 255, green: 0, blue: 255};
|
|
|
|
const Magenta: RGB = {red: 255, green: 0, blue: 255}
|
|
|
|
const Orange: RGB = {red: 255, green: 130, blue: 0};
|
|
|
|
const Orange: RGB = {red: 255, green: 130, blue: 0};
|
|
|
|
const colorSpotify: RGB = {red: 30, green: 215, blue: 96};
|
|
|
|
const colorSpotify: RGB = {red: 30, green: 215, blue: 96};
|
|
|
|
const colorAlexa: RGB = {red: 49, green: 196, blue: 243};
|
|
|
|
const colorAlexa: RGB = {red: 49, green: 196, blue: 243};
|
|
|
|
@@ -406,10 +401,10 @@ const defaultBackgroundColorParam: any = HMIDark;
|
|
|
|
- Servicemenü aus pages "NSPanel_Service" unter pages kommentieren ("//" hinzufügen)
|
|
|
|
- Servicemenü aus pages "NSPanel_Service" unter pages kommentieren ("//" hinzufügen)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************************************
|
|
|
|
/*************************************************************************************************
|
|
|
|
** Service pages with auto alias (subsequent pages are automatically created with alias) **
|
|
|
|
** Service pages with auto alias (subsequent pages are automatically created with alias) **
|
|
|
|
** https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Service-Men%C3%BC **
|
|
|
|
** https://github.com/joBr99/nspanel-lovelace-ui/wiki/NSPanel-Service-Men%C3%BC **
|
|
|
|
***********************************************************************************************/
|
|
|
|
************************************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/* EN: English
|
|
|
|
/* EN: English
|
|
|
|
If the service menu needs to be secured, a cardUnlock can be installed upstream.
|
|
|
|
If the service menu needs to be secured, a cardUnlock can be installed upstream.
|
|
|
|
@@ -822,7 +817,7 @@ export const config: Config = {
|
|
|
|
NSPanel_Wifi_Info_2, //Auto-Alias Service Page
|
|
|
|
NSPanel_Wifi_Info_2, //Auto-Alias Service Page
|
|
|
|
NSPanel_Sensoren, //Auto-Alias Service Page
|
|
|
|
NSPanel_Sensoren, //Auto-Alias Service Page
|
|
|
|
NSPanel_Hardware, //Auto-Alias Service Page
|
|
|
|
NSPanel_Hardware, //Auto-Alias Service Page
|
|
|
|
NSPanel_IoBroker, //Auto-Alias Service Page
|
|
|
|
NSPanel_IoBroker, //Auot-Alias Service Page
|
|
|
|
NSPanel_Einstellungen, //Auto-Alias Service Page
|
|
|
|
NSPanel_Einstellungen, //Auto-Alias Service Page
|
|
|
|
NSPanel_Screensaver, //Auto-Alias Service Page
|
|
|
|
NSPanel_Screensaver, //Auto-Alias Service Page
|
|
|
|
NSPanel_ScreensaverDimmode, //Auto-Alias Service Page
|
|
|
|
NSPanel_ScreensaverDimmode, //Auto-Alias Service Page
|
|
|
|
@@ -992,8 +987,8 @@ 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 = 'v5.0.2.1';
|
|
|
|
const scriptVersion: string = 'v5.0.0.1';
|
|
|
|
const tft_version: string = 'v5.0.2';
|
|
|
|
const tft_version: string = 'v5.0.0';
|
|
|
|
const desired_display_firmware_version = 59;
|
|
|
|
const desired_display_firmware_version = 59;
|
|
|
|
const berry_driver_version = 10;
|
|
|
|
const berry_driver_version = 10;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1062,6 +1057,7 @@ 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 (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);
|
|
|
|
@@ -3467,6 +3463,11 @@ let scheduleSendDate = adapterSchedule(new Date().setMinutes(0, 0), 60 * 60, ()
|
|
|
|
SendDate();
|
|
|
|
SendDate();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 3:30 a.m. Perform startup and receive current TFT version
|
|
|
|
|
|
|
|
let scheduleStartup = adapterSchedule({hour: 3, minute: 30}, 24 * 60 * 60, async () => {
|
|
|
|
|
|
|
|
setIfExists(config.panelSendTopic, 'pageType~pageStartup');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Check for updates with Start
|
|
|
|
// Check for updates with Start
|
|
|
|
get_locales();
|
|
|
|
get_locales();
|
|
|
|
get_locales_servicemenu();
|
|
|
|
get_locales_servicemenu();
|
|
|
|
@@ -3895,7 +3896,6 @@ function get_current_tasmota_ip_address () {
|
|
|
|
log('error at function get_current_tasmota_ip_address: ' + err.message, 'warn');
|
|
|
|
log('error at function get_current_tasmota_ip_address: ' + err.message, 'warn');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Retrieves the current IP address of the Tasmota device.
|
|
|
|
* Retrieves the current IP address of the Tasmota device.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@@ -4374,6 +4374,7 @@ on({id: config.panelRecvTopic}, async (obj) => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Updates the Berry driver version on the NSPanel.
|
|
|
|
* Updates the Berry driver version on the NSPanel.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@@ -5227,7 +5228,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* The same extension can be found below in blind. vval=0 means closed / val=100 means open. If val is in between, icon3 is used.
|
|
|
|
* The same extension can be found below in blind. vval=0 means closed / val=100 means open. If val is in between, icon3 is used.
|
|
|
|
* Icons in this part can be states and strings. The specifications are based on German shutters.
|
|
|
|
* Icons in this part can be states and strings. The specifications are based on German shutters.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['window-shutter', 'window-shutter-open', 'window-shutter-alert']);
|
|
|
|
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['window-shutter', 'window-shutter-open', 'window-shutter-alert']);
|
|
|
|
iconColor = existsState(pageItem.id + '.COLORDEC')
|
|
|
|
iconColor = existsState(pageItem.id + '.COLORDEC')
|
|
|
|
? getState(pageItem.id + '.COLORDEC').val
|
|
|
|
? getState(pageItem.id + '.COLORDEC').val
|
|
|
|
@@ -5337,7 +5338,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
if (role == 'temperature' || role == 'value.temperature' || role == 'thermostat') {
|
|
|
|
if (role == 'temperature' || role == 'value.temperature' || role == 'thermostat') {
|
|
|
|
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['snowflake-thermometer', 'sun-thermometer', 'thermometer']);
|
|
|
|
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['snowflake-thermometer', 'sun-thermometer', 'thermometer']);
|
|
|
|
} else if (role == 'humidity' || role == 'value.humidity') {
|
|
|
|
} else if (role == 'humidity' || role == 'value.humidity') {
|
|
|
|
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['water-off', 'water-percent-alert', 'water-percent']);
|
|
|
|
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['water-off', 'water-percent-alert' , 'water-percent']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iconColor = GetIconColor(pageItem, parseInt(optVal), useColors);
|
|
|
|
iconColor = GetIconColor(pageItem, parseInt(optVal), useColors);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -5444,7 +5445,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
type = 'light';
|
|
|
|
type = 'light';
|
|
|
|
} else if (pageItem.popupVersion == 2) {
|
|
|
|
} else if (pageItem.popupVersion == 2){
|
|
|
|
type = 'light2';
|
|
|
|
type = 'light2';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -5488,7 +5489,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
type = 'light';
|
|
|
|
type = 'light';
|
|
|
|
} else if (pageItem.popupVersion == 2) {
|
|
|
|
} else if (pageItem.popupVersion == 2){
|
|
|
|
type = 'light2';
|
|
|
|
type = 'light2';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -5528,7 +5529,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
type = 'light';
|
|
|
|
type = 'light';
|
|
|
|
} else if (pageItem.popupVersion == 2) {
|
|
|
|
} else if (pageItem.popupVersion == 2){
|
|
|
|
type = 'light2';
|
|
|
|
type = 'light2';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -5583,7 +5584,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
type = 'light';
|
|
|
|
type = 'light';
|
|
|
|
} else if (pageItem.popupVersion == 2) {
|
|
|
|
} else if (pageItem.popupVersion == 2){
|
|
|
|
type = 'light2';
|
|
|
|
type = 'light2';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -5610,7 +5611,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
if (Debug) log('CIE wurde zuletzt geändert - Lampe ist Color-Mode');
|
|
|
|
if (Debug) log('CIE wurde zuletzt geändert - Lampe ist Color-Mode');
|
|
|
|
if (getState(pageItem.id + '.CIE').val != null) {
|
|
|
|
if (getState(pageItem.id + '.CIE').val != null) {
|
|
|
|
let cie: string = getState(pageItem.id + '.CIE').val;
|
|
|
|
let cie: string = getState(pageItem.id + '.CIE').val;
|
|
|
|
let cieArray = (cie.substring(1, cie.length - 1)).split(',');
|
|
|
|
let cieArray = (cie.substring(1, cie.length -1)).split(',');
|
|
|
|
let rgb: RGB = cie_to_rgb(parseFloat(cieArray[0]), parseFloat(cieArray[1]), 254);
|
|
|
|
let rgb: RGB = cie_to_rgb(parseFloat(cieArray[0]), parseFloat(cieArray[1]), 254);
|
|
|
|
let cRGB: RGB = lightenDarkenColor(ConvertRGBtoHex(rgb.red, rgb.green, rgb.blue), (100 - brightness) * -1);
|
|
|
|
let cRGB: RGB = lightenDarkenColor(ConvertRGBtoHex(rgb.red, rgb.green, rgb.blue), (100 - brightness) * -1);
|
|
|
|
iconColor = rgb_dec565(pageItem.interpolateColor !== undefined ? cRGB : config.defaultOnColor);
|
|
|
|
iconColor = rgb_dec565(pageItem.interpolateColor !== undefined ? cRGB : config.defaultOnColor);
|
|
|
|
@@ -5637,7 +5638,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
type = 'light';
|
|
|
|
type = 'light';
|
|
|
|
} else if (pageItem.popupVersion == 2) {
|
|
|
|
} else if (pageItem.popupVersion == 2){
|
|
|
|
type = 'light2';
|
|
|
|
type = 'light2';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -5693,7 +5694,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
type = 'light';
|
|
|
|
type = 'light';
|
|
|
|
} else if (pageItem.popupVersion == 2) {
|
|
|
|
} else if (pageItem.popupVersion == 2){
|
|
|
|
type = 'light2';
|
|
|
|
type = 'light2';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -5719,7 +5720,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion !== undefined) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
if (pageItem.popupVersion == 1) {
|
|
|
|
type = 'shutter';
|
|
|
|
type = 'shutter';
|
|
|
|
} else if (pageItem.popupVersion == 2) {
|
|
|
|
} else if (pageItem.popupVersion == 2){
|
|
|
|
type = 'shutter2';
|
|
|
|
type = 'shutter2';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -5860,7 +5861,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
if (role == 'temperature' || role == 'value.temperature' || role == 'thermostat') {
|
|
|
|
if (role == 'temperature' || role == 'value.temperature' || role == 'thermostat') {
|
|
|
|
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['snowflake-thermometer', 'sun-thermometer', 'thermometer']);
|
|
|
|
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['snowflake-thermometer', 'sun-thermometer', 'thermometer']);
|
|
|
|
} else if (role == 'humidity' || role == 'value.humidity') {
|
|
|
|
} else if (role == 'humidity' || role == 'value.humidity') {
|
|
|
|
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['water-off', 'water-percent-alert', 'water-percent']);
|
|
|
|
iconId = determinePageItemStatusIcon(pageItem, val, iconId, ['water-off', 'water-percent-alert' , 'water-percent']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
iconColor = GetIconColor(pageItem, parseInt(optVal), useColors);
|
|
|
|
iconColor = GetIconColor(pageItem, parseInt(optVal), useColors);
|
|
|
|
@@ -5908,7 +5909,7 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (existsState(pageItem.id + '.ACTUAL') && (pageItem.icon2 != undefined || pageItem.useValue)) {
|
|
|
|
if (existsState(pageItem.id + '.ACTUAL') && pageItem.icon2 != undefined) {
|
|
|
|
// Read Alias Datapoint Objectdata
|
|
|
|
// Read Alias Datapoint Objectdata
|
|
|
|
let obj = getObject(pageItem.id + ".ACTUAL");
|
|
|
|
let obj = getObject(pageItem.id + ".ACTUAL");
|
|
|
|
// Read origin Datapoint Objectdata
|
|
|
|
// Read origin Datapoint Objectdata
|
|
|
|
@@ -5920,22 +5921,16 @@ function CreateEntity (pageItem: PageItem, placeId: number, useColors: boolean =
|
|
|
|
if (obj2.type === 'state' && obj2.common.type == "boolean") {
|
|
|
|
if (obj2.type === 'state' && obj2.common.type == "boolean") {
|
|
|
|
if (Debug) log(getState(obj.common.alias.id).val, 'info');
|
|
|
|
if (Debug) log(getState(obj.common.alias.id).val, 'info');
|
|
|
|
if (getState(obj.common.alias.id).val) {
|
|
|
|
if (getState(obj.common.alias.id).val) {
|
|
|
|
if (!pageItem.useValue) iconId = pageItem.icon != undefined ? Icons.GetIcon(pageItem.icon) : iconId;
|
|
|
|
iconId = pageItem.icon != undefined ? Icons.GetIcon(pageItem.icon) : iconId;
|
|
|
|
iconColor = pageItem.onColor != undefined ? rgb_dec565(pageItem.onColor) : iconColor;
|
|
|
|
iconColor = pageItem.onColor != undefined ? rgb_dec565(pageItem.onColor) : iconColor;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (!pageItem.useValue) iconId = pageItem.icon2 != undefined ? Icons.GetIcon(pageItem.icon2) : iconId;
|
|
|
|
iconId = pageItem.icon2 != undefined ? Icons.GetIcon(pageItem.icon2) : iconId;
|
|
|
|
iconColor = pageItem.offColor != undefined ? rgb_dec565(pageItem.offColor) : iconColor;
|
|
|
|
iconColor = pageItem.offColor != undefined ? rgb_dec565(pageItem.offColor) : iconColor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (existsState(pageItem.id + '.COLORDEC')) {
|
|
|
|
|
|
|
|
if (Debug) log('iconcolor von ' + pageItem.id + '.COLORDEC: ' + getState(pageItem.id + '.COLORDEC').val, 'info');
|
|
|
|
|
|
|
|
RegisterEntityWatcher(pageItem.id + '.COLORDEC');
|
|
|
|
|
|
|
|
iconColor = getState(pageItem.id + '.COLORDEC').val;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Debug) log('CreateEntity Icon role info, humidity, temperature, value.temperature, value.humidity, sensor.door, sensor.window, thermostat', 'info');
|
|
|
|
if (Debug) log('CreateEntity Icon role info, humidity, temperature, value.temperature, value.humidity, sensor.door, sensor.window, thermostat', 'info');
|
|
|
|
if (Debug) log('CreateEntity ~' + type + '~' + placeId + '~' + iconId + '~' + iconColor + '~' + name + '~' + optVal + ' ' + unit, 'info');
|
|
|
|
if (Debug) log('CreateEntity ~' + type + '~' + placeId + '~' + iconId + '~' + iconColor + '~' + name + '~' + optVal + ' ' + unit, 'info');
|
|
|
|
return '~' + type + '~' + placeId + '~' + iconId + '~' + iconColor + '~' + name + '~' + optVal + ' ' + unit;
|
|
|
|
return '~' + type + '~' + placeId + '~' + iconId + '~' + iconColor + '~' + name + '~' + optVal + ' ' + unit;
|
|
|
|
@@ -7038,7 +7033,7 @@ function GenerateThermo2Page (page: NSPanel.PageThermo2): NSPanel.Payload[] {
|
|
|
|
'~' +
|
|
|
|
'~' +
|
|
|
|
getNavigationString(pageId) + // 2-13 Page Navigation
|
|
|
|
getNavigationString(pageId) + // 2-13 Page Navigation
|
|
|
|
/*-Temp Control-----------------------------------*/
|
|
|
|
/*-Temp Control-----------------------------------*/
|
|
|
|
'~' + id + '~' + destTemp + '~' + minTemp + '~' + maxTemp + '~' + stepTemp + '~' + unit + '~' + /* 20 */ actualModeState +
|
|
|
|
'~' + id + '~' + destTemp + '~' + minTemp + '~' + maxTemp + '~' + stepTemp + '~' + unit + '~' + '1' +
|
|
|
|
/* Entity 1 - Actual Temperature (Icon) */
|
|
|
|
/* Entity 1 - Actual Temperature (Icon) */
|
|
|
|
'~text~' + pageId + '?1~' + Icons.GetIcon('thermometer') + '~' + tempColor + '~~' +
|
|
|
|
'~text~' + pageId + '?1~' + Icons.GetIcon('thermometer') + '~' + tempColor + '~~' +
|
|
|
|
/* Entity 2 - Actual Temperature (Temp) */
|
|
|
|
/* Entity 2 - Actual Temperature (Temp) */
|
|
|
|
@@ -7052,7 +7047,7 @@ function GenerateThermo2Page (page: NSPanel.PageThermo2): NSPanel.Payload[] {
|
|
|
|
/* Entity 6 - Actual Humidity (Unit) */
|
|
|
|
/* Entity 6 - Actual Humidity (Unit) */
|
|
|
|
'~text~' + pageId + '?6~' + humidityUnit + '~' + humColor + '~~' +
|
|
|
|
'~text~' + pageId + '?6~' + humidityUnit + '~' + humColor + '~~' +
|
|
|
|
/* Entity 7 - Text-State */
|
|
|
|
/* Entity 7 - Text-State */
|
|
|
|
'~text~' + pageId + '?7~' + modeStatus + '~' + textStateColor + '~~' + /* 62 */ actualModeState;
|
|
|
|
'~text~' + pageId + '?7~' + modeStatus + '~' + textStateColor + '~~' + actualModeState;
|
|
|
|
|
|
|
|
|
|
|
|
for (let i=0; i<9; i++) {
|
|
|
|
for (let i=0; i<9; i++) {
|
|
|
|
if(page.items[i] != undefined) {
|
|
|
|
if(page.items[i] != undefined) {
|
|
|
|
@@ -7158,7 +7153,6 @@ function subscribeMediaSubscriptionsSonosAdd (id: string): void {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Creates media aliases for a specific media device and adapter player instance.
|
|
|
|
* Creates media aliases for a specific media device and adapter player instance.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@@ -8015,9 +8009,9 @@ function GenerateMediaPage (page: NSPanel.PageMedia): NSPanel.Payload[] {
|
|
|
|
page.items[0].playList = getState(page.items[0].adapterPlayerInstance + 'playlists.playlistListString').val.split(';');
|
|
|
|
page.items[0].playList = getState(page.items[0].adapterPlayerInstance + 'playlists.playlistListString').val.split(';');
|
|
|
|
} else if (v2Adapter == 'mpd') {
|
|
|
|
} else if (v2Adapter == 'mpd') {
|
|
|
|
let tempPL = getState(page.items[0].adapterPlayerInstance + 'listplaylists').val;
|
|
|
|
let tempPL = getState(page.items[0].adapterPlayerInstance + 'listplaylists').val;
|
|
|
|
tempPL = tempPL.replace('[', '');
|
|
|
|
tempPL = tempPL.replace('[','');
|
|
|
|
tempPL = tempPL.replace(']', '');
|
|
|
|
tempPL = tempPL.replace(']','');
|
|
|
|
tempPL = tempPL.replaceAll('"', '');
|
|
|
|
tempPL = tempPL.replaceAll('"','');
|
|
|
|
page.items[0].playList = tempPL.split(',');
|
|
|
|
page.items[0].playList = tempPL.split(',');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
playListIconCol = rgb_dec565(HMIOn);
|
|
|
|
playListIconCol = rgb_dec565(HMIOn);
|
|
|
|
@@ -9100,7 +9094,6 @@ function triggerButton (id: string): boolean {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// End Monobutton
|
|
|
|
// End Monobutton
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@@ -11367,49 +11360,6 @@ function GenerateDetailPage (type: NSPanel.PopupType, optional: NSPanel.mediaOpt
|
|
|
|
hSlider3Visibility // If Slider Tap > --> tmSerial 28
|
|
|
|
hSlider3Visibility // If Slider Tap > --> tmSerial 28
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else { // no Media Item
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let tSlider2: string = "";
|
|
|
|
|
|
|
|
let tIconS2M: string = Icons.GetIcon("minus-box");
|
|
|
|
|
|
|
|
let tIconS2P: string = Icons.GetIcon("plus-box");
|
|
|
|
|
|
|
|
let hSlider2MinVal: number = pageItem.minValue ?? 0;
|
|
|
|
|
|
|
|
let hSlider2MaxVal: number = pageItem.maxValue ?? 100;
|
|
|
|
|
|
|
|
let hSlider2ZeroVal: number = 0;
|
|
|
|
|
|
|
|
let hSlider2CurVal: number = getState(id + '.ACTUAL').val;
|
|
|
|
|
|
|
|
let hSlider2Step: number = 1;
|
|
|
|
|
|
|
|
let hSlider2Visibility: string = "enable";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
out_msgs.push({
|
|
|
|
|
|
|
|
payload:
|
|
|
|
|
|
|
|
'entityUpdateDetail' +
|
|
|
|
|
|
|
|
'~' + //entityUpdateDetail
|
|
|
|
|
|
|
|
tempId +
|
|
|
|
|
|
|
|
// Slider1
|
|
|
|
|
|
|
|
'~~~~~~~~~disable' +
|
|
|
|
|
|
|
|
// Slider2
|
|
|
|
|
|
|
|
'~' +
|
|
|
|
|
|
|
|
tSlider2 + // Slider2 Headline --> tmSerial 11
|
|
|
|
|
|
|
|
'~' +
|
|
|
|
|
|
|
|
tIconS2M + // Slider2 Left Icon --> tmSerial 12
|
|
|
|
|
|
|
|
'~' +
|
|
|
|
|
|
|
|
tIconS2P + // Slider2 Right Icon --> tmSerial 13
|
|
|
|
|
|
|
|
'~' +
|
|
|
|
|
|
|
|
hSlider2CurVal + // Slider2 Current Slider Value --> tmSerial 14
|
|
|
|
|
|
|
|
'~' +
|
|
|
|
|
|
|
|
hSlider2MinVal + // Slider2 Minimal Slider Value --> tmSerial 15
|
|
|
|
|
|
|
|
'~' +
|
|
|
|
|
|
|
|
hSlider2MaxVal + // Slider2 Maximal Slider Value --> tmSerial 16
|
|
|
|
|
|
|
|
'~' +
|
|
|
|
|
|
|
|
hSlider2ZeroVal + // If Slider2 0 is betweeb Min and Max --> tmSerial 17
|
|
|
|
|
|
|
|
'~' +
|
|
|
|
|
|
|
|
hSlider2Step + // If Slider2 Tap > 1 --> tmSerial 18
|
|
|
|
|
|
|
|
'~' +
|
|
|
|
|
|
|
|
hSlider2Visibility + // If Slider Tap > --> tmSerial 19
|
|
|
|
|
|
|
|
// Slider3
|
|
|
|
|
|
|
|
'~~~~~~~~~disable'
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -12674,7 +12624,7 @@ function HandleScreensaverUpdate (): void {
|
|
|
|
|
|
|
|
|
|
|
|
arraySunEvent[0] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.00.sunriseTime').val).getTime();
|
|
|
|
arraySunEvent[0] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.00.sunriseTime').val).getTime();
|
|
|
|
arraySunEvent[1] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.00.sunsetTime').val).getTime();
|
|
|
|
arraySunEvent[1] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.00.sunsetTime').val).getTime();
|
|
|
|
arraySunEvent[2] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.01.sunriseTime').val).getTime();
|
|
|
|
arraySunEvent[0] = getDateObject(getState('pirate-weather.' + weatherAdapterInstanceNumber + '.weather.daily.00.sunriseTime').val).getTime();
|
|
|
|
|
|
|
|
|
|
|
|
let j = 0;
|
|
|
|
let j = 0;
|
|
|
|
for (j = 0; j < 3; j++) {
|
|
|
|
for (j = 0; j < 3; j++) {
|
|
|
|
@@ -12698,7 +12648,7 @@ function HandleScreensaverUpdate (): void {
|
|
|
|
|
|
|
|
|
|
|
|
arraySunEvent[0] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.00.sunrise').val).getTime();
|
|
|
|
arraySunEvent[0] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.00.sunrise').val).getTime();
|
|
|
|
arraySunEvent[1] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.00.sunset').val).getTime();
|
|
|
|
arraySunEvent[1] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.00.sunset').val).getTime();
|
|
|
|
arraySunEvent[2] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.01.sunrise').val).getTime();
|
|
|
|
arraySunEvent[0] = getDateObject(getState('brightsky.' + weatherAdapterInstanceNumber + '.daily.00.sunrise').val).getTime();
|
|
|
|
|
|
|
|
|
|
|
|
let j = 0;
|
|
|
|
let j = 0;
|
|
|
|
for (j = 0; j < 3; j++) {
|
|
|
|
for (j = 0; j < 3; j++) {
|
|
|
|
@@ -13921,7 +13871,6 @@ on({id: config.panelRecvTopic.substring(0, config.panelRecvTopic.length - 'RESUL
|
|
|
|
log('error Trigger reading senor-data: ' + err.message, 'warn');
|
|
|
|
log('error Trigger reading senor-data: ' + err.message, 'warn');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//------------------End Read Internal Sensor Data
|
|
|
|
//------------------End Read Internal Sensor Data
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@@ -14369,7 +14318,6 @@ function determineStatusIcon (
|
|
|
|
if (min === undefined || max === undefined) {
|
|
|
|
if (min === undefined || max === undefined) {
|
|
|
|
return iconId;
|
|
|
|
return iconId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function pickIcon(iconKey?: string, defIndex?: number): string {
|
|
|
|
function pickIcon(iconKey?: string, defIndex?: number): string {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
(iconKey && existsState(iconKey) && Icons.GetIcon(getState(iconKey).val)) ||
|
|
|
|
(iconKey && existsState(iconKey) && Icons.GetIcon(getState(iconKey).val)) ||
|
|
|
|
@@ -14410,7 +14358,6 @@ function spotifyGetDeviceID (vDeviceString: string): string {
|
|
|
|
let strDevID = arrayDeviceListIds[indexPos];
|
|
|
|
let strDevID = arrayDeviceListIds[indexPos];
|
|
|
|
return strDevID;
|
|
|
|
return strDevID;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Join arguments with ~ and return the string;
|
|
|
|
* Join arguments with ~ and return the string;
|
|
|
|
* @param tokens unlimited numbers of strings
|
|
|
|
* @param tokens unlimited numbers of strings
|
|
|
|
@@ -14486,7 +14433,6 @@ function _schedule (time: {hour?: number; minute?: number} | undefined | number,
|
|
|
|
const timeout = targetTime - new Date().getTime();
|
|
|
|
const timeout = targetTime - new Date().getTime();
|
|
|
|
scheduleList[ref] = setTimeout(_schedule, timeout, time, ref, repeatTime, callback);
|
|
|
|
scheduleList[ref] = setTimeout(_schedule, timeout, time, ref, repeatTime, callback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Clears a scheduled task based on the reference ID.
|
|
|
|
* Clears a scheduled task based on the reference ID.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@@ -14501,7 +14447,6 @@ function _clearSchedule (ref: number): null {
|
|
|
|
delete scheduleList[ref];
|
|
|
|
delete scheduleList[ref];
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const ArrayPlayerTypeWithMediaDevice = ['alexa2', 'sonos', 'squeezeboxrpc'] as const;
|
|
|
|
const ArrayPlayerTypeWithMediaDevice = ['alexa2', 'sonos', 'squeezeboxrpc'] as const;
|
|
|
|
const ArrayPlayerTypeWithOutMediaDevice = ['spotify-premium', 'volumio', 'bosesoundtouch', 'mpd'] as const;
|
|
|
|
const ArrayPlayerTypeWithOutMediaDevice = ['spotify-premium', 'volumio', 'bosesoundtouch', 'mpd'] as const;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -14517,7 +14462,6 @@ const ArrayPlayerTypeWithOutMediaDevice = ['spotify-premium', 'volumio', 'boseso
|
|
|
|
function isPlayerWithMediaDevice (F: string | NSPanel._PlayerTypeWithMediaDevice): F is NSPanel._PlayerTypeWithMediaDevice {
|
|
|
|
function isPlayerWithMediaDevice (F: string | NSPanel._PlayerTypeWithMediaDevice): F is NSPanel._PlayerTypeWithMediaDevice {
|
|
|
|
return ArrayPlayerTypeWithMediaDevice.indexOf(F as NSPanel._PlayerTypeWithMediaDevice) != -1;
|
|
|
|
return ArrayPlayerTypeWithMediaDevice.indexOf(F as NSPanel._PlayerTypeWithMediaDevice) != -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** check if NSPanel.adapterPlayerInstanceType has all Playertypes */
|
|
|
|
/** check if NSPanel.adapterPlayerInstanceType has all Playertypes */
|
|
|
|
function checkSortedPlayerType (F: NSPanel.notSortedPlayerType) {
|
|
|
|
function checkSortedPlayerType (F: NSPanel.notSortedPlayerType) {
|
|
|
|
const test: NSPanel.adapterPlayerInstanceType = F;
|
|
|
|
const test: NSPanel.adapterPlayerInstanceType = F;
|
|
|
|
@@ -14603,12 +14547,10 @@ function isPopupType (F: NSPanel.PopupType | string): F is NSPanel.PopupType {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// If u get a error here u forgot something in PagetypeType or PageType
|
|
|
|
// If u get a error here u forgot something in PagetypeType or PageType
|
|
|
|
function checkPageType (F: NSPanel.PagetypeType, A: NSPanel.PageType) {
|
|
|
|
function checkPageType (F: NSPanel.PagetypeType, A: NSPanel.PageType) {
|
|
|
|
A.type = F;
|
|
|
|
A.type = F;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function isPageMediaItem (F: NSPanel.PageItem | NSPanel.PageMediaItem): F is NSPanel.PageMediaItem {
|
|
|
|
function isPageMediaItem (F: NSPanel.PageItem | NSPanel.PageMediaItem): F is NSPanel.PageMediaItem {
|
|
|
|
return 'adapterPlayerInstance' in F;
|
|
|
|
return 'adapterPlayerInstance' in F;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -14620,7 +14562,6 @@ function isPageThermoItem (F: PageItem | NSPanel.PageThermoItem): F is NSPanel.P
|
|
|
|
function isPageMedia (F: NSPanel.PageType | NSPanel.PageMedia): F is NSPanel.PageMedia {
|
|
|
|
function isPageMedia (F: NSPanel.PageType | NSPanel.PageMedia): F is NSPanel.PageMedia {
|
|
|
|
return F.type == 'cardMedia';
|
|
|
|
return F.type == 'cardMedia';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function isPagePower (F: NSPanel.PageType | NSPanel.PagePower): F is NSPanel.PagePower {
|
|
|
|
function isPagePower (F: NSPanel.PageType | NSPanel.PagePower): F is NSPanel.PagePower {
|
|
|
|
return F.type == 'cardPower';
|
|
|
|
return F.type == 'cardPower';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|