mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-19 14:14:12 +01:00
Types and variables for popupShutter2 changed.
This commit is contained in:
@@ -9129,10 +9129,10 @@ function HandleButtonEvent (words: any): void {
|
||||
break;
|
||||
case 'button1Press':
|
||||
let pageItemShutterButton1 = findPageItem(id);
|
||||
if (pageItemShutterButton1.customIcons[0].Button1.buttonType != undefined && pageItemShutterButton1.customIcons[0].Button1.buttonType == 'toggle') {
|
||||
toggleState(pageItemShutterButton1.customIcons[0].Button1.id);
|
||||
} else if (pageItemShutterButton1.customIcons[0].Button1.buttonType != undefined && pageItemShutterButton1.customIcons[0].Button1.buttonType == 'press') {
|
||||
setIfExists(pageItemShutterButton1.customIcons[0].Button1.id, true);
|
||||
if (pageItemShutterButton1.customIcons[0].buttonType != undefined && pageItemShutterButton1.customIcons[0].buttonType == 'toggle') {
|
||||
toggleState(pageItemShutterButton1.customIcons[0].id);
|
||||
} else if (pageItemShutterButton1.customIcons[0].buttonType != undefined && pageItemShutterButton1.customIcons[0].buttonType == 'press') {
|
||||
setIfExists(pageItemShutterButton1.customIcons[0].id, true);
|
||||
} else {
|
||||
//do nothing
|
||||
}
|
||||
@@ -9140,10 +9140,10 @@ function HandleButtonEvent (words: any): void {
|
||||
break;
|
||||
case 'button2Press':
|
||||
let pageItemShutterButton2 = findPageItem(id);
|
||||
if (pageItemShutterButton2.customIcons[0].Button2.buttonType != undefined && pageItemShutterButton2.customIcons[0].Button2.buttonType == 'toggle') {
|
||||
toggleState(pageItemShutterButton2.customIcons[0].Button2.id);
|
||||
} else if (pageItemShutterButton2.customIcons[0].Button2.buttonType != undefined && pageItemShutterButton2.customIcons[0].Button2.buttonType == 'press') {
|
||||
setIfExists(pageItemShutterButton2.customIcons[0].Button2.id, true);
|
||||
if (pageItemShutterButton2.customIcons[1].buttonType != undefined && pageItemShutterButton2.customIcons[1].buttonType == 'toggle') {
|
||||
toggleState(pageItemShutterButton2.customIcons[1].id);
|
||||
} else if (pageItemShutterButton2.customIcons[1].buttonType != undefined && pageItemShutterButton2.customIcons[1].buttonType == 'press') {
|
||||
setIfExists(pageItemShutterButton2.customIcons[1].id, true);
|
||||
} else {
|
||||
//do nothing
|
||||
}
|
||||
@@ -9151,10 +9151,10 @@ function HandleButtonEvent (words: any): void {
|
||||
break;
|
||||
case 'button3Press':
|
||||
let pageItemShutterButton3 = findPageItem(id);
|
||||
if (pageItemShutterButton3.customIcons[0].Button3.buttonType != undefined && pageItemShutterButton3.customIcons[0].Button3.buttonType == 'toggle') {
|
||||
toggleState(pageItemShutterButton3.customIcons[0].Button3.id);
|
||||
} else if (pageItemShutterButton3.customIcons[0].Button3.buttonType != undefined && pageItemShutterButton3.customIcons[0].Button3.buttonType == 'press') {
|
||||
setIfExists(pageItemShutterButton3.customIcons[0].Button3.id, true);
|
||||
if (pageItemShutterButton3.customIcons[2].buttonType != undefined && pageItemShutterButton3.customIcons[2].buttonType == 'toggle') {
|
||||
toggleState(pageItemShutterButton3.customIcons[2].id);
|
||||
} else if (pageItemShutterButton3.customIcons[2].buttonType != undefined && pageItemShutterButton3.customIcons[2].buttonType == 'press') {
|
||||
setIfExists(pageItemShutterButton3.customIcons[2].id, true);
|
||||
} else {
|
||||
//do nothing
|
||||
}
|
||||
@@ -11090,17 +11090,17 @@ function GenerateDetailPage (type: NSPanel.PopupType, optional: NSPanel.mediaOpt
|
||||
let bEntity1Icon : string = 'power';
|
||||
let bEntity1Color : number = rgb_dec565(White);
|
||||
let bEntity1Visibility : string = 'disable';
|
||||
if (pageItem.customIcons[0].Button1 != undefined) {
|
||||
if (pageItem.customIcons[0].Button1.id != undefined) {
|
||||
if (pageItem.customIcons[0] != undefined) {
|
||||
if (pageItem.customIcons[0].id != undefined) {
|
||||
bEntity1Visibility = 'enable';
|
||||
RegisterDetailEntityWatcher(pageItem.customIcons[0].Button1.id, pageItem, type, placeId);
|
||||
bEntity1State = getState(pageItem.customIcons[0].Button1.id).val;
|
||||
RegisterDetailEntityWatcher(pageItem.customIcons[0].id, pageItem, type, placeId);
|
||||
bEntity1State = getState(pageItem.customIcons[0].id).val;
|
||||
if (bEntity1State) {
|
||||
bEntity1Icon = Icons.GetIcon(pageItem.customIcons[0].Button1.icon) ?? bEntity1Icon;
|
||||
bEntity1Color = rgb_dec565(pageItem.customIcons[0].Button1.iconOnColor) ?? bEntity1Color;
|
||||
bEntity1Icon = Icons.GetIcon(pageItem.customIcons[0].icon) ?? bEntity1Icon;
|
||||
bEntity1Color = rgb_dec565(pageItem.customIcons[0].iconOnColor) ?? bEntity1Color;
|
||||
} else {
|
||||
bEntity1Icon = Icons.GetIcon(pageItem.customIcons[0].Button1.icon2) ?? bEntity1Icon;
|
||||
bEntity1Color = rgb_dec565(pageItem.customIcons[0].Button1.iconOffColor) ?? bEntity1Color;
|
||||
bEntity1Icon = Icons.GetIcon(pageItem.customIcons[0].icon2) ?? bEntity1Icon;
|
||||
bEntity1Color = rgb_dec565(pageItem.customIcons[0].iconOffColor) ?? bEntity1Color;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11110,17 +11110,17 @@ function GenerateDetailPage (type: NSPanel.PopupType, optional: NSPanel.mediaOpt
|
||||
let bEntity2Icon : string = 'power';
|
||||
let bEntity2Color : number = rgb_dec565(White);
|
||||
let bEntity2Visibility : string = 'disable';
|
||||
if (pageItem.customIcons[0].Button2 != undefined) {
|
||||
if (pageItem.customIcons[0].Button2.id != undefined) {
|
||||
if (pageItem.customIcons[1] != undefined) {
|
||||
if (pageItem.customIcons[1].id != undefined) {
|
||||
bEntity2Visibility = 'enable';
|
||||
RegisterDetailEntityWatcher(pageItem.customIcons[0].Button2.id, pageItem, type, placeId);
|
||||
bEntity2State = getState(pageItem.customIcons[0].Button2.id).val;
|
||||
RegisterDetailEntityWatcher(pageItem.customIcons[1].id, pageItem, type, placeId);
|
||||
bEntity2State = getState(pageItem.customIcons[1].id).val;
|
||||
if (bEntity2State) {
|
||||
bEntity2Icon = Icons.GetIcon(pageItem.customIcons[0].Button2.icon) ?? bEntity2Icon;
|
||||
bEntity2Color = rgb_dec565(pageItem.customIcons[0].Button2.iconOnColor) ?? bEntity2Color;
|
||||
bEntity2Icon = Icons.GetIcon(pageItem.customIcons[1].icon) ?? bEntity2Icon;
|
||||
bEntity2Color = rgb_dec565(pageItem.customIcons[1].iconOnColor) ?? bEntity2Color;
|
||||
} else {
|
||||
bEntity2Icon = Icons.GetIcon(pageItem.customIcons[0].Button2.icon2) ?? bEntity2Icon;
|
||||
bEntity2Color = rgb_dec565(pageItem.customIcons[0].Button2.iconOffColor) ?? bEntity2Color;
|
||||
bEntity2Icon = Icons.GetIcon(pageItem.customIcons[1].icon2) ?? bEntity2Icon;
|
||||
bEntity2Color = rgb_dec565(pageItem.customIcons[1].iconOffColor) ?? bEntity2Color;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11130,17 +11130,17 @@ function GenerateDetailPage (type: NSPanel.PopupType, optional: NSPanel.mediaOpt
|
||||
let bEntity3Icon : string = 'power';
|
||||
let bEntity3Color : number = rgb_dec565(White);
|
||||
let bEntity3Visibility : string = 'disable';
|
||||
if (pageItem.customIcons[0].Button3 != undefined) {
|
||||
if (pageItem.customIcons[0].Button3.id != undefined) {
|
||||
if (pageItem.customIcons[2] != undefined) {
|
||||
if (pageItem.customIcons[2].id != undefined) {
|
||||
bEntity3Visibility = 'enable';
|
||||
RegisterDetailEntityWatcher(pageItem.customIcons[0].Button3.id, pageItem, type, placeId);
|
||||
bEntity3State = getState(pageItem.customIcons[0].Button3.id).val;
|
||||
RegisterDetailEntityWatcher(pageItem.customIcons[2].id, pageItem, type, placeId);
|
||||
bEntity3State = getState(pageItem.customIcons[2].id).val;
|
||||
if (bEntity3State) {
|
||||
bEntity3Icon = Icons.GetIcon(pageItem.customIcons[0].Button3.icon) ?? bEntity3Icon;
|
||||
bEntity3Color = rgb_dec565(pageItem.customIcons[0].Button3.iconOnColor) ?? bEntity3Color;
|
||||
bEntity3Icon = Icons.GetIcon(pageItem.customIcons[2].icon) ?? bEntity3Icon;
|
||||
bEntity3Color = rgb_dec565(pageItem.customIcons[2].iconOnColor) ?? bEntity3Color;
|
||||
} else {
|
||||
bEntity3Icon = Icons.GetIcon(pageItem.customIcons[0].Button3.icon2) ?? bEntity3Icon;
|
||||
bEntity3Color = rgb_dec565(pageItem.customIcons[0].Button3.iconOffColor) ?? bEntity3Color;
|
||||
bEntity3Icon = Icons.GetIcon(pageItem.customIcons[2].icon2) ?? bEntity3Icon;
|
||||
bEntity3Color = rgb_dec565(pageItem.customIcons[2].iconOffColor) ?? bEntity3Color;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13973,7 +13973,7 @@ namespace NSPanel {
|
||||
monobutton?: boolean;
|
||||
inSel_ChoiceState?: boolean;
|
||||
iconArray?: string[];
|
||||
customIcons?: any[];
|
||||
customIcons?: [ customIcons?, customIcons?, customIcons?] | null;
|
||||
fontSize?: number;
|
||||
actionStringArray?: string[];
|
||||
alwaysOnDisplay?: boolean;
|
||||
@@ -13981,6 +13981,15 @@ namespace NSPanel {
|
||||
shutterType?: string;
|
||||
};
|
||||
|
||||
type customIcons = {
|
||||
id: string;
|
||||
icon: string;
|
||||
icon2?: string;
|
||||
iconOnColor?: RGB;
|
||||
iconOffColor?: RGB;
|
||||
buttonType: string;
|
||||
};
|
||||
|
||||
export type DimMode = {
|
||||
dimmodeOn: boolean | undefined;
|
||||
brightnessDay: number | undefined;
|
||||
|
||||
Reference in New Issue
Block a user