mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-16 01:46:59 +01:00
Compare commits
4 Commits
d0e463de98
...
3904ca2343
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3904ca2343 | ||
|
|
8ebd0f5193 | ||
|
|
8c9bca3f25 | ||
|
|
6908744669 |
@@ -542,6 +542,7 @@ let NSPanel_Service_SubPage: PageType =
|
||||
/*PageItem*/{ id: AliasPath + 'IoBroker.ScriptVersion', name: findLocaleServMenu('script_version_nspanelts'), offColor: Menu, onColor: Menu },
|
||||
/*PageItem*/{ id: AliasPath + 'IoBroker.NodeJSVersion', name: findLocaleServMenu('nodejs_version'), offColor: Menu, onColor: Menu },
|
||||
/*PageItem*/{ id: AliasPath + 'IoBroker.JavaScriptVersion', name: findLocaleServMenu('instance_javascript'), offColor: Menu, onColor: Menu },
|
||||
/*PageItem*/{ id: AliasPath + 'IoBroker.ScriptName', name: findLocaleServMenu('scriptname'), offColor: Menu, onColor: Menu },
|
||||
]
|
||||
};
|
||||
|
||||
@@ -1039,7 +1040,18 @@ async function CheckConfigParameters() {
|
||||
log('Config-Parameter: << config.panelRecvTopic - ' + config.panelRecvTopic + ' >> is not reachable. Please Check Parameters!','error');
|
||||
}
|
||||
if (existsObject(config.panelSendTopic) == false) {
|
||||
log('Config-Parameter: << config.panelSendTopic - ' + config.panelSendTopic + ' >> is not reachable. Please Check Parameters!','error');
|
||||
const n = config.panelSendTopic.split('.');
|
||||
const a = n.shift();
|
||||
const i = n.shift();
|
||||
|
||||
if (a === 'mqtt' && !isNaN(Number(i))) {
|
||||
sendTo(`${a}.${i}`, 'sendMessage2Client', {topic: n.join('/'), message: 'time~12:00'});
|
||||
await sleep(500);
|
||||
}
|
||||
if (await existsObjectAsync(config.panelSendTopic) == false) {
|
||||
log('Config-Parameter: << config.panelSendTopic - ' + config.panelSendTopic + ' >> is not reachable. Please Check Parameters!','error');
|
||||
stopScript(scriptName);
|
||||
}
|
||||
}
|
||||
if (weatherAdapterInstance.substring(0, weatherAdapterInstance.length - 3) == 'daswetter') {
|
||||
if (existsObject(weatherAdapterInstance + 'NextHours.Location_1.Day_1.current.symbol_value') == false) {
|
||||
@@ -1064,6 +1076,7 @@ async function CheckConfigParameters() {
|
||||
if (common.name == 'javascript') {
|
||||
javaScriptVersion = common.version;
|
||||
setIfExists(NSPanel_Path + 'IoBroker.JavaScriptVersion', 'v' + javaScriptVersion);
|
||||
setIfExists(NSPanel_Path + 'IoBroker.ScriptName', (name as unknown as string).split('.').slice(2).join('.'));
|
||||
let jsVersion = common.version.split('.');
|
||||
let jsV = 10*parseInt(jsVersion[0]) + parseInt(jsVersion[1]);
|
||||
if (jsV<61) log('JS-Adapter: ' + common.name + ' must be at least v6.1.3. Currently: v' + common.version, 'error');
|
||||
@@ -1116,6 +1129,10 @@ async function InitIoBrokerInfo() {
|
||||
await createStateAsync(NSPanel_Path + 'IoBroker.JavaScriptVersion', 'v' + javaScriptVersion, { type: 'string' });
|
||||
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' });
|
||||
// ScriptName
|
||||
await createStateAsync(NSPanel_Path + 'IoBroker.ScriptName', 'v' + javaScriptVersion, { type: 'string' });
|
||||
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' });
|
||||
}
|
||||
setIfExists(NSPanel_Path + 'IoBroker.ScriptVersion', scriptVersion);
|
||||
} catch (err: any) {
|
||||
@@ -2204,7 +2221,7 @@ let scheduleSendDate = schedule('0 * * * *', () => {
|
||||
|
||||
// 3:30 a.m. Perform startup and receive current TFT version
|
||||
let scheduleStartup = schedule({ hour: 3, minute: 30 }, async () => {
|
||||
await setStateAsync(config.panelSendTopic, 'pageType~pageStartup');
|
||||
setIfExists(config.panelSendTopic, 'pageType~pageStartup');
|
||||
});
|
||||
|
||||
// Updates currently compare every 12 hours
|
||||
@@ -2217,7 +2234,7 @@ let scheduleCheckUpdates = schedule('{"time":{"start":"00:00","end":"23:59","mod
|
||||
// Check for updates with Start
|
||||
get_locales();
|
||||
get_locales_servicemenu();
|
||||
setState(config.panelSendTopic, 'pageType~pageStartup');
|
||||
setIfExists(config.panelSendTopic, 'pageType~pageStartup');
|
||||
get_tasmota_status0();
|
||||
get_panel_update_data();
|
||||
check_updates();
|
||||
@@ -2326,7 +2343,7 @@ async function check_updates() {
|
||||
if (existsState(NSPanel_Path + 'NSPanel_autoUpdate')) {
|
||||
if (getState(NSPanel_Path + 'NSPanel_autoUpdate').val) {
|
||||
|
||||
if (Debug) log('Auto-Updates eingeschaltet - Update Tasmota wird durchgeführt', 'info');
|
||||
log('Auto-Updates eingeschaltet - Update Tasmota wird durchgeführt', 'info');
|
||||
|
||||
// Perform Tasmota upgrade
|
||||
update_tasmota_firmware();
|
||||
@@ -2354,7 +2371,7 @@ async function check_updates() {
|
||||
if (existsState(NSPanel_Path + 'NSPanel_autoUpdate')) {
|
||||
if (getState(NSPanel_Path + 'NSPanel_autoUpdate').val) {
|
||||
|
||||
if (Debug) log('Auto-updates switched on - Berry driver update is carried out', 'info');
|
||||
log('Auto-updates switched on - Berry driver update is carried out', 'info');
|
||||
|
||||
// Tasmota Berry-Driver Update durchführen
|
||||
update_berry_driver_version();
|
||||
@@ -2384,7 +2401,7 @@ async function check_updates() {
|
||||
if (existsState(NSPanel_Path + 'NSPanel_autoUpdate')) {
|
||||
if (getState(NSPanel_Path + 'NSPanel_autoUpdate').val) {
|
||||
|
||||
if (Debug) log('Auto-updates switched on - update TFT firmware is carried out', 'info');
|
||||
log('Auto-updates switched on - update TFT firmware is carried out', 'info');
|
||||
|
||||
// TFT-Firmware Update durchführen
|
||||
update_tft_firmware();
|
||||
@@ -2951,13 +2968,13 @@ async function SendToPanel(val: Payload | Payload[]) {
|
||||
try {
|
||||
if (Array.isArray(val)) {
|
||||
val.forEach(function (id) {
|
||||
setStateAsync(config.panelSendTopic, id.payload);
|
||||
setIfExists(config.panelSendTopic, id.payload);
|
||||
if (Debug) {
|
||||
log('function SendToPanel payload: ' + id.payload, 'info');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
setState(config.panelSendTopic, val.payload);
|
||||
setIfExists(config.panelSendTopic, val.payload);
|
||||
}
|
||||
|
||||
} catch (err: any) {
|
||||
@@ -3021,7 +3038,7 @@ function HandleMessage(typ: string, method: EventMethod, page: number | undefine
|
||||
tempId = tempPageItem[0];
|
||||
}
|
||||
let pageItem: PageItem = findPageItem(tempId);
|
||||
if (pageItem !== undefined) {
|
||||
if (pageItem !== undefined && isPopupType(words[2])) {
|
||||
let temp: string | mediaOptional | undefined = tempPageItem[1]
|
||||
if (isMediaOptional(temp)) SendToPanel(GenerateDetailPage(words[2], temp, pageItem, placeId));
|
||||
else SendToPanel(GenerateDetailPage(words[2], undefined, pageItem, placeId));
|
||||
@@ -4191,7 +4208,7 @@ function RegisterEntityWatcher(id: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
function RegisterDetailEntityWatcher(id: string, pageItem: PageItem, type: string, placeId: number | undefined): void {
|
||||
function RegisterDetailEntityWatcher(id: string, pageItem: PageItem, type: PopupType, placeId: number | undefined): void {
|
||||
try {
|
||||
if (subscriptions.hasOwnProperty(id)) {
|
||||
return;
|
||||
@@ -4713,7 +4730,7 @@ function subscribeMediaSubscriptionsBoseAdd(id: string): void {
|
||||
|
||||
async function createAutoMediaAlias (id: string, mediaDevice: string, adapterPlayerInstance: adapterPlayerInstanceType) {
|
||||
if (autoCreateAlias) {
|
||||
if (isSetOptionActive) {
|
||||
if (isSetOptionActive) {
|
||||
switch (adapterPlayerInstance) {
|
||||
case "alexa2.0.":
|
||||
case "alexa2.1.":
|
||||
@@ -5203,7 +5220,7 @@ function GenerateMediaPage(page: PageMedia): Payload[] {
|
||||
let shuffle_icon = Icons.GetIcon('shuffle-variant'); //shuffle
|
||||
let onoffbutton = 1374;
|
||||
|
||||
if (shuffle == 'off' || shuffle == false || shuffle == 0) {
|
||||
if (shuffle == 'off' || shuffle == false || shuffle == 0 || shuffle == 'false') {
|
||||
shuffle_icon = Icons.GetIcon('shuffle-disabled'); //shuffle
|
||||
}
|
||||
if (v2Adapter == 'volumio') { shuffle_icon = Icons.GetIcon('refresh'); } //Volumio: refresh playlist
|
||||
@@ -6434,7 +6451,7 @@ function HandleButtonEvent(words: any): void {
|
||||
GeneratePage(activePage!);
|
||||
break;
|
||||
case 'bosesoundtouch':
|
||||
log(adapterInstanceRepeat);
|
||||
if (Debug) log(adapterInstanceRepeat);
|
||||
let stateBoseRepeat = getState(id + '.REPEAT').val
|
||||
if (stateBoseRepeat == 'REPEAT_OFF') {
|
||||
setIfExists(adapterInstanceRepeat + 'key', 'REPEAT_ALL');
|
||||
@@ -6644,10 +6661,18 @@ function HandleButtonEvent(words: any): void {
|
||||
setIfExists(id + '.SET', parseInt(temps[0]) / 10);
|
||||
}
|
||||
break;
|
||||
case 'media-back':
|
||||
setIfExists(id + '.PREV', true);
|
||||
GeneratePage(activePage!);
|
||||
case 'media-back': {
|
||||
const tempPage = findPageItem(id);
|
||||
if (isPageMediaItem(tempPage)) {
|
||||
if (tempPage.adapterPlayerInstance.startsWith('bosesoundtouch')) {
|
||||
setIfExists(tempPage.adapterPlayerInstance + 'key', 'PREV_TRACK');
|
||||
} else {
|
||||
setIfExists(id + '.PREV', true);
|
||||
}
|
||||
GeneratePage(activePage!);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'media-pause':
|
||||
let pageItemTemp = findPageItem(id);
|
||||
if (isPageMediaItem(pageItemTemp)) {
|
||||
@@ -6663,6 +6688,8 @@ function HandleButtonEvent(words: any): void {
|
||||
} else if (stateVal == null) {
|
||||
setState(adapterPlayerInstanceStateSeceltor, 1);
|
||||
}
|
||||
} else if (pageItemTemp.adapterPlayerInstance.startsWith('bosesoundtouch')) {
|
||||
setIfExists(pageItemTemp.adapterPlayerInstance + 'key', 'PLAY_PAUSE');
|
||||
} else {
|
||||
if (Debug) log('HandleButtonEvent media-pause -> .STATE Value: ' + getState(id + '.STATE').val, 'info');
|
||||
if (getState(id + '.STATE').val === true) {
|
||||
@@ -6674,11 +6701,19 @@ function HandleButtonEvent(words: any): void {
|
||||
GeneratePage(activePage!);
|
||||
}
|
||||
break;
|
||||
case 'media-next':
|
||||
setIfExists(id + '.NEXT', true);
|
||||
GeneratePage(activePage!);
|
||||
case 'media-next': {
|
||||
const tempPage = findPageItem(id);
|
||||
if (isPageMediaItem(tempPage)) {
|
||||
if (tempPage.adapterPlayerInstance.startsWith('bosesoundtouch')) {
|
||||
setIfExists(tempPage.adapterPlayerInstance + 'key', 'NEXT_TRACK');
|
||||
} else {
|
||||
setIfExists(id + '.NEXT', true);
|
||||
}
|
||||
GeneratePage(activePage!);
|
||||
}
|
||||
break;
|
||||
case 'media-shuffle':
|
||||
}
|
||||
case 'media-shuffle': {
|
||||
const tempPage = findPageItem(id);
|
||||
if (isPageMediaItem(tempPage)) {
|
||||
if (tempPage.adapterPlayerInstance.startsWith("volumio")) {
|
||||
@@ -6708,8 +6743,8 @@ function HandleButtonEvent(words: any): void {
|
||||
}
|
||||
}
|
||||
if ((tempPage.adapterPlayerInstance).startsWith("bosesoundtouch")) {
|
||||
log(tempPage.adapterPlayerInstance);
|
||||
if (getState(tempPage.adapterPlayerInstance + '.SHUFFLE').val == false) {
|
||||
if (Debug) log(tempPage.adapterPlayerInstance + 'nowPlaying.shuffle');
|
||||
if (getState(tempPage.adapterPlayerInstance + 'nowPlaying.shuffle').val == 'false') {
|
||||
setIfExists(tempPage.adapterPlayerInstance + 'key', 'SHUFFLE_ON');
|
||||
} else {
|
||||
setIfExists(tempPage.adapterPlayerInstance + 'key', 'SHUFFLE_OFF');
|
||||
@@ -6718,6 +6753,7 @@ function HandleButtonEvent(words: any): void {
|
||||
GeneratePage(activePage!);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'volumeSlider':
|
||||
pageCounter = -1;
|
||||
(function () { if (timeoutSlider) { clearTimeout(timeoutSlider); timeoutSlider = null; } })();
|
||||
@@ -6824,8 +6860,8 @@ function HandleButtonEvent(words: any): void {
|
||||
setState([pageItemPL.adapterPlayerInstance, 'Players', pageItemPL.mediaDevice, 'cmdPlayFavorite'].join('.'), words[4]);
|
||||
break;
|
||||
case "bosesoundtouch":
|
||||
log('bosesoundtouch - playlist ' + pageItemPL.adapterPlayerInstance + ' - ' + words[4]);
|
||||
log(adapterInstancePL + 'key');
|
||||
if (Debug) log('bosesoundtouch - playlist ' + pageItemPL.adapterPlayerInstance + ' - ' + words[4]);
|
||||
if (Debug) log(adapterInstancePL + 'key');
|
||||
setState(adapterInstancePL + 'key', 'PRESET_' + (parseInt(words[4]) + 1));
|
||||
break;
|
||||
default:
|
||||
@@ -7300,7 +7336,7 @@ function GetNavigationString(pageId: number): string {
|
||||
}
|
||||
return '';
|
||||
}
|
||||
function GenerateDetailPage(type: string, optional: mediaOptional | undefined, pageItem: PageItem, placeId: number | undefined): Payload[] {
|
||||
function GenerateDetailPage(type: PopupType, optional: mediaOptional | undefined, pageItem: PageItem, placeId: number | undefined): Payload[] {
|
||||
if (Debug) log('GenerateDetailPage Übergabe Type: ' + type + ' - optional: ' + optional + ' - pageItem.id: ' + pageItem.id, 'info');
|
||||
try {
|
||||
let out_msgs: Array<Payload> = [];
|
||||
@@ -7968,7 +8004,7 @@ function GenerateDetailPage(type: string, optional: mediaOptional | undefined, p
|
||||
let actualMode = pageItem.modeList![getState(id + '.MODE').val];
|
||||
|
||||
let tempId = placeId != undefined ? placeId : id;
|
||||
|
||||
// {tempid | icon | iconColor | switchVal | actualSpeed | maxSpeed: | findLocale | actualMode | modeList}
|
||||
out_msgs.push({
|
||||
payload: 'entityUpdateDetail' + '~' // entityUpdateDetail
|
||||
+ tempId + '~'
|
||||
@@ -7988,35 +8024,13 @@ function GenerateDetailPage(type: string, optional: mediaOptional | undefined, p
|
||||
if (role == 'media') {
|
||||
let actualState: any = '';
|
||||
let optionalString: string = 'Kein Eintrag';
|
||||
let mode: string = '';
|
||||
let mode: mediaOptional | '' = '';
|
||||
if (isPageMediaItem(pageItem)) {
|
||||
const vTempAdapter = (pageItem.adapterPlayerInstance!).split('.');
|
||||
const vAdapter: PlayerType = vTempAdapter[0] as PlayerType;
|
||||
if (optional == 'seek') {
|
||||
let actualStateTemp: number = getState(pageItem.adapterPlayerInstance + 'root.' + pageItem.mediaDevice + '.seek').val;
|
||||
if (actualStateTemp >= 95) {
|
||||
actualState = '100%';
|
||||
} else if (actualStateTemp >= 85) {
|
||||
actualState = '90%';
|
||||
} else if (actualStateTemp >= 75) {
|
||||
actualState = '80%';
|
||||
} else if (actualStateTemp >= 65) {
|
||||
actualState = '70%';
|
||||
} else if (actualStateTemp >= 55) {
|
||||
actualState = '60%';
|
||||
} else if (actualStateTemp >= 45) {
|
||||
actualState = '50%';
|
||||
} else if (actualStateTemp >= 35) {
|
||||
actualState = '40%';
|
||||
} else if (actualStateTemp >= 25) {
|
||||
actualState = '30%';
|
||||
} else if (actualStateTemp >= 15) {
|
||||
actualState = '20%';
|
||||
} else if (actualStateTemp >= 5) {
|
||||
actualState = '10%';
|
||||
} else if (actualStateTemp >= 0) {
|
||||
actualState = '0%';
|
||||
}
|
||||
const actualStateTemp: number = getState(pageItem.adapterPlayerInstance + 'root.' + pageItem.mediaDevice + '.seek').val;
|
||||
actualState = Math.round(actualStateTemp / 10) * 10 + '%';
|
||||
if (vAdapter == 'sonos') {
|
||||
optionalString = '0%?10%?20%?30%?40%?50%?60%?70%?80%?90%?100%';
|
||||
}
|
||||
@@ -8086,11 +8100,17 @@ function GenerateDetailPage(type: string, optional: mediaOptional | undefined, p
|
||||
} else if (vAdapter == 'bosesoundtouch') {
|
||||
if (existsObject(pageItem.adapterPlayerInstance + 'deviceInfo.name')) {
|
||||
actualState = formatInSelText(getState(pageItem.adapterPlayerInstance + 'deviceInfo.name').val);
|
||||
log(actualState);
|
||||
}
|
||||
let tempPlayList: string[] = [];
|
||||
for (let i = 0; i < pageItem.playList!.length; i++) {
|
||||
tempPlayList[i] = formatInSelText(pageItem.playList![i]);
|
||||
let vPreset: string = 'No Entry';
|
||||
for (let i = 1; i < 7; i++) {
|
||||
if (getState(pageItem.adapterPlayerInstance + 'presets.'+ i +'.source').val !== null) {
|
||||
vPreset = getState(pageItem.adapterPlayerInstance + 'presets.'+ i + '.source').val;
|
||||
} else {
|
||||
vPreset = 'Preset ' + i.toFixed;
|
||||
}
|
||||
tempPlayList[i - 1] = formatInSelText(vPreset.replace('_',' '));
|
||||
if (Debug) log(formatInSelText(vPreset.replace('_',' ')))
|
||||
}
|
||||
optionalString = pageItem.playList != undefined ? tempPlayList.join('?') : ''
|
||||
} else if (vAdapter == 'sonos') {
|
||||
@@ -8215,7 +8235,7 @@ function GenerateDetailPage(type: string, optional: mediaOptional | undefined, p
|
||||
}
|
||||
|
||||
let tempId = placeId != undefined ? placeId : id;
|
||||
|
||||
// {tempid | color | mediaOptional | actualState | optionalString}
|
||||
out_msgs.push({
|
||||
payload: 'entityUpdateDetail2' + '~' //entityUpdateDetail
|
||||
+ tempId + '?' + optional + '~~' //{entity_id}
|
||||
@@ -8244,7 +8264,7 @@ function GenerateDetailPage(type: string, optional: mediaOptional | undefined, p
|
||||
let valueList = pageItem.modeList != undefined ? tempModeList.join('?') : '';
|
||||
|
||||
let tempId = placeId != undefined ? placeId : id;
|
||||
|
||||
// {tempid | color | mediaOptional | actualValue | valueList}
|
||||
out_msgs.push({
|
||||
payload: 'entityUpdateDetail2' + '~' //entityUpdateDetail2
|
||||
+ tempId + '~~' //{entity_id}
|
||||
@@ -8280,7 +8300,7 @@ function GenerateDetailPage(type: string, optional: mediaOptional | undefined, p
|
||||
|
||||
//log(valueList);
|
||||
let tempId = placeId != undefined ? placeId : id;
|
||||
|
||||
// {tempid | color | 'insel' | actualValue | valueList}
|
||||
out_msgs.push({
|
||||
payload: 'entityUpdateDetail2' + '~' //entityUpdateDetail2
|
||||
+ tempId + '~~' //{entity_id}
|
||||
@@ -8673,10 +8693,8 @@ function HandleScreensaverUpdate(): void {
|
||||
if (screensaverAdvanced) {
|
||||
// 5 indicatorScreensaverEntities
|
||||
for (let i = 0; i < 5 && i < config.indicatorScreensaverEntity.length; i++) {
|
||||
let checkpoint = true;
|
||||
const indicatorScreensaverEntity:ScreenSaverElementWithUndefined = config.indicatorScreensaverEntity[i];
|
||||
if (indicatorScreensaverEntity === null || indicatorScreensaverEntity === undefined) {
|
||||
checkpoint = false;
|
||||
break;
|
||||
}
|
||||
RegisterScreensaverEntityWatcher(indicatorScreensaverEntity.ScreensaverEntity)
|
||||
@@ -9563,8 +9581,9 @@ function rgb_to_cie(red: number, green: number, blue: number): string
|
||||
|
||||
return cie;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param vDeviceString
|
||||
* @returns
|
||||
*/
|
||||
@@ -9577,6 +9596,9 @@ function spotifyGetDeviceID(vDeviceString: string): string {
|
||||
let strDevID = arrayDeviceListIds[indexPos];
|
||||
return strDevID;
|
||||
}
|
||||
type PopupType = 'popupFan' | 'popupInSel' | 'popupLight' | 'popupLightNew' | 'popupNotify' | 'popupShutter' | 'popupThermo' | 'popupTimer'
|
||||
|
||||
|
||||
|
||||
type EventMethod = 'startup' | 'sleepReached' | 'pageOpenDetail' | 'buttonPress2' | 'renderCurrentPage' | 'button1' | 'button2'
|
||||
|
||||
@@ -9625,7 +9647,7 @@ type PageBaseType = {
|
||||
homeIconColor?: RGB
|
||||
};
|
||||
|
||||
type PagetypeType = 'cardChart' | 'cardLChart' | 'cardEntities' |'cardGrid'|'cardGrid2'|'cardThermo'|'cardMedia'|'cardUnlock'|'cardQR'|'cardAlarm'|'cardPower'
|
||||
type PagetypeType = 'cardChart' | 'cardLChart' | 'cardEntities' |'cardGrid'|'cardGrid2'|'cardThermo'|'cardMedia'|'cardUnlock'|'cardQR'|'cardAlarm'|'cardPower' //| 'cardBurnRec'
|
||||
|
||||
type PageType = PageChart | PageEntities | PageGrid | PageGrid2 | PageThermo | PageMedia | PageUnlock | PageQR | PageAlarm | PagePower
|
||||
|
||||
@@ -9715,6 +9737,14 @@ type PageThermoItem = {
|
||||
popUpThermoName?: string[],
|
||||
setThermoAlias?: string[],
|
||||
setThermoDestTemp2?: string,
|
||||
} & PageBaseItem |
|
||||
{
|
||||
popupThermoMode1?: string[],
|
||||
popupThermoMode2?: string[],
|
||||
popupThermoMode3?: string[],
|
||||
popUpThermoName?: string[],
|
||||
setThermoAlias?: string[],
|
||||
setThermoDestTemp2?: string,
|
||||
} & PageBaseItem
|
||||
|
||||
type PageBaseItem = {
|
||||
@@ -9796,7 +9826,7 @@ type Config = {
|
||||
button2: ConfigButtonFunction
|
||||
}
|
||||
type leftScreensaverEntityType = [ScreenSaverElementWithUndefined, ScreenSaverElementWithUndefined, ScreenSaverElementWithUndefined] | [];
|
||||
type indicatorScreensaverEntityType = [ScreenSaverElementWithUndefined, ScreenSaverElementWithUndefined, ScreenSaverElementWithUndefined, ScreenSaverElementWithUndefined, ScreenSaverElementWithUndefined] | [];
|
||||
type indicatorScreensaverEntityType = [ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?] | [];
|
||||
type ScreenSaverElementWithUndefined = null | undefined | ScreenSaverElement
|
||||
type ScreenSaverElement = {
|
||||
ScreensaverEntity: string,
|
||||
@@ -9892,3 +9922,20 @@ function isEventMethod(F: string | EventMethod): F is EventMethod {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isPopupType(F: PopupType | string): F is PopupType {
|
||||
switch(F as PopupType) {
|
||||
case "popupFan":
|
||||
case "popupInSel":
|
||||
case "popupLight":
|
||||
case "popupLightNew":
|
||||
case "popupNotify":
|
||||
case "popupShutter":
|
||||
case "popupThermo":
|
||||
case "popupTimer":
|
||||
return true;
|
||||
default:
|
||||
log(`Please report to developer: Unknown PopupType: ${F} `, 'warn');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user