mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-18 10:57:01 +01:00
DEV 4.4.0.8 - Update NSPanelTs.ts
- Add "Custom Icon" Object to cardThermo (Climate Alias Channel)
This commit is contained in:
@@ -129,7 +129,8 @@ ReleaseNotes:
|
|||||||
- 09.10.2024 - v4.4.0.7 Fix: first start and initialisation with new NSPanel device - Fix by wolwin
|
- 09.10.2024 - v4.4.0.7 Fix: first start and initialisation with new NSPanel device - Fix by wolwin
|
||||||
- 25.10.2024 - v4.4.0.8 Fix: InitDimmode => timeDimMode Day / timeDimMode Night
|
- 25.10.2024 - v4.4.0.8 Fix: InitDimmode => timeDimMode Day / timeDimMode Night
|
||||||
- 25.10.2024 - v4.4.0.8 Add Always On Display (AOD) to cardTHermo
|
- 25.10.2024 - v4.4.0.8 Add Always On Display (AOD) to cardTHermo
|
||||||
- 25.10.2024 - v4.4.0.8 Add Hide Buttons at Power Off to cardThermo (Climate Mode)
|
- 25.10.2024 - v4.4.0.8 Add Hide Buttons at Power Off to cardThermo (Climate Alias Channel)
|
||||||
|
- 26.10.2024 - v4.4.0.8 Add Custom Icon Object to cartdThermo (Climate Alias Channel
|
||||||
|
|
||||||
Todo:
|
Todo:
|
||||||
- XX.12.2024 - v5.0.0 ioBroker Adapter
|
- XX.12.2024 - v5.0.0 ioBroker Adapter
|
||||||
@@ -5006,7 +5007,6 @@ function GenerateThermoPage(page: NSPanel.PageThermo): NSPanel.Payload[] {
|
|||||||
UnsubscribeWatcher();
|
UnsubscribeWatcher();
|
||||||
let id = page.items[0].id;
|
let id = page.items[0].id;
|
||||||
let out_msgs: NSPanel.Payload[] = [];
|
let out_msgs: NSPanel.Payload[] = [];
|
||||||
//out_msgs.push({ payload: 'pageType~cardThermo' });
|
|
||||||
|
|
||||||
// Leave the display on if the alwaysOnDisplay parameter is specified (true)
|
// Leave the display on if the alwaysOnDisplay parameter is specified (true)
|
||||||
if (page.type == 'cardThermo' && pageCounter == 0 && page.items[0].alwaysOnDisplay != undefined) {
|
if (page.type == 'cardThermo' && pageCounter == 0 && page.items[0].alwaysOnDisplay != undefined) {
|
||||||
@@ -5066,6 +5066,14 @@ function GenerateThermoPage(page: NSPanel.PageThermo): NSPanel.Payload[] {
|
|||||||
|
|
||||||
let tempIcon: string = '';
|
let tempIcon: string = '';
|
||||||
|
|
||||||
|
let iconsObj: any;
|
||||||
|
if (page.items[0].customIcons != undefined) {
|
||||||
|
iconsObj = page.items[0].customIcons[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
let tempIconOnColor: number = 35921;
|
||||||
|
let tempIconOffColor: number = 35921;
|
||||||
|
|
||||||
if (i_list.length - 3 != 0) {
|
if (i_list.length - 3 != 0) {
|
||||||
let i = 0;
|
let i = 0;
|
||||||
switch (o.common.role as NSPanel.roles) {
|
switch (o.common.role as NSPanel.roles) {
|
||||||
@@ -5234,72 +5242,90 @@ function GenerateThermoPage(page: NSPanel.PageThermo): NSPanel.Payload[] {
|
|||||||
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[1] !== '') {
|
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[1] !== '') {
|
||||||
tempIcon = page.items[0].iconArray[1];
|
tempIcon = page.items[0].iconArray[1];
|
||||||
} else {
|
} else {
|
||||||
tempIcon = 'air-conditioner';
|
tempIcon = iconsObj != undefined ? iconsObj['AUTO']['iconName'] : 'air-conditioner';
|
||||||
|
tempIconOnColor = iconsObj != undefined ? rgb_dec565(iconsObj['AUTO']['iconOnColor']) : 1024;
|
||||||
|
tempIconOffColor = iconsObj != undefined ? rgb_dec565(iconsObj['AUTO']['iconOffColor']) : 35921;
|
||||||
}
|
}
|
||||||
if (stateKeyNumber == Mode) {
|
if (stateKeyNumber == Mode) {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~1024~1~' + 'AUTO' + '~';
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOnColor +'~1~' + 'AUTO' + '~';
|
||||||
} else {
|
} else {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'AUTO' + '~';
|
//bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~0~' + 'AUTO' + '~'; bis HMI Fix
|
||||||
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~1~' + 'AUTO' + '~';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'COOL':
|
case 'COOL':
|
||||||
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[2] !== '') {
|
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[2] !== '') {
|
||||||
tempIcon = page.items[0].iconArray[2];
|
tempIcon = page.items[0].iconArray[2];
|
||||||
} else {
|
} else {
|
||||||
tempIcon = 'snowflake';
|
tempIcon = iconsObj != undefined ? iconsObj['COOL']["iconName"] : 'snowflake';
|
||||||
|
tempIconOnColor = iconsObj != undefined ? rgb_dec565(iconsObj['COOL']["iconOnColor"]) : 11487;
|
||||||
|
tempIconOffColor = iconsObj != undefined ? rgb_dec565(iconsObj['COOL']['iconOffColor']) : 35921;
|
||||||
}
|
}
|
||||||
if (stateKeyNumber == Mode) {
|
if (stateKeyNumber == Mode) {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~11487~1~' + 'COOL' + '~';
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOnColor +'~1~' + 'COOL' + '~';
|
||||||
} else {
|
} else {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'COOL' + '~';
|
//bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~0~' + 'COOL' + '~'; bis HMI Fix
|
||||||
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~1~' + 'COOL' + '~';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'HEAT':
|
case 'HEAT':
|
||||||
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[3] !== '') {
|
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[3] !== '') {
|
||||||
tempIcon = page.items[0].iconArray[3];
|
tempIcon = page.items[0].iconArray[3];
|
||||||
} else {
|
} else {
|
||||||
tempIcon = 'fire';
|
tempIcon = iconsObj != undefined ? iconsObj['HEAT']["iconName"] : 'fire';
|
||||||
|
tempIconOnColor = iconsObj != undefined ? rgb_dec565(iconsObj['HEAT']["iconOnColor"]) : 64512;
|
||||||
|
tempIconOffColor = iconsObj != undefined ? rgb_dec565(iconsObj['HEAT']['iconOffColor']) : 35921;
|
||||||
}
|
}
|
||||||
if (stateKeyNumber == Mode) {
|
if (stateKeyNumber == Mode) {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~64512~1~' + 'HEAT' + '~';
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOnColor +'~1~' + 'HEAT' + '~';
|
||||||
} else {
|
} else {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'HEAT' + '~';
|
//bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~0~' + 'HEAT' + '~'; bis HMI Fix
|
||||||
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~1~' + 'HEAT' + '~';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'ECO':
|
case 'ECO':
|
||||||
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[4] !== '') {
|
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[4] !== '') {
|
||||||
tempIcon = page.items[0].iconArray[4];
|
tempIcon = page.items[0].iconArray[4];
|
||||||
} else {
|
} else {
|
||||||
tempIcon = 'alpha-e-circle-outline';
|
tempIcon = iconsObj != undefined ? iconsObj['ECO']["iconName"] : 'alpha-e-circle-outline';
|
||||||
|
tempIconOnColor = iconsObj != undefined ? rgb_dec565(iconsObj['ECO']["iconOnColor"]) : 2016;
|
||||||
|
tempIconOffColor = iconsObj != undefined ? rgb_dec565(iconsObj['ECO']['iconOffColor']) : 35921;
|
||||||
}
|
}
|
||||||
if (stateKeyNumber == Mode) {
|
if (stateKeyNumber == Mode) {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'ECO' + '~';
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOnColor +'~1~' + 'ECO' + '~';
|
||||||
} else {
|
} else {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'ECO' + '~';
|
//bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~0~' + 'ECO' + '~'; bis HMI Fix
|
||||||
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~1~' + 'ECO' + '~';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'FAN_ONLY':
|
case 'FAN_ONLY':
|
||||||
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[5] !== '') {
|
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[5] !== '') {
|
||||||
tempIcon = page.items[0].iconArray[5];
|
tempIcon = page.items[0].iconArray[5];
|
||||||
} else {
|
} else {
|
||||||
tempIcon = 'fan';
|
tempIcon = iconsObj != undefined ? iconsObj['FAN_ONLY']['iconName'] : 'fan';
|
||||||
|
tempIconOnColor = iconsObj != undefined ? rgb_dec565(iconsObj['FAN_ONLY']['iconOnColor']) : 11487;
|
||||||
|
tempIconOffColor = iconsObj != undefined ? rgb_dec565(iconsObj['FAN_ONLY']['iconOffColor']) : 35921;
|
||||||
}
|
}
|
||||||
if (stateKeyNumber == Mode) {
|
if (stateKeyNumber == Mode) {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~11487~1~' + 'FAN_ONLY' + '~';
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOnColor +'~1~' + 'FAN_ONLY' + '~';
|
||||||
} else {
|
} else {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'FAN_ONLY' + '~';
|
//bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~0~' + 'FAN_ONLY' + '~'; bis HMI Fix
|
||||||
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~1~' + 'FAN_ONLY' + '~';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'DRY':
|
case 'DRY':
|
||||||
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[6] !== '') {
|
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[6] !== '') {
|
||||||
tempIcon = page.items[0].iconArray[6];
|
tempIcon = page.items[0].iconArray[6];
|
||||||
} else {
|
} else {
|
||||||
tempIcon = 'water-percent';
|
tempIcon = iconsObj != undefined ? iconsObj["DRY"]["iconName"] : 'water-percent';
|
||||||
|
tempIconOnColor = iconsObj != undefined ? rgb_dec565(iconsObj["DRY"]["iconOnColor"]) : 60897;
|
||||||
|
tempIconOffColor = iconsObj != undefined ? rgb_dec565(iconsObj["DRY"]["iconOffColor"]) : 35921;
|
||||||
}
|
}
|
||||||
if (stateKeyNumber == Mode) {
|
if (stateKeyNumber == Mode) {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~60897~1~' + 'DRY' + '~';
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOnColor +'~1~' + 'DRY' + '~';
|
||||||
} else {
|
} else {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'DRY' + '~';
|
//bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~0~' + 'DRY' + '~'; // bis HMI Fix
|
||||||
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~1~' + 'DRY' + '~';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -5310,13 +5336,16 @@ function GenerateThermoPage(page: NSPanel.PageThermo): NSPanel.Payload[] {
|
|||||||
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[4] !== '') {
|
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[4] !== '') {
|
||||||
tempIcon = page.items[0].iconArray[4];
|
tempIcon = page.items[0].iconArray[4];
|
||||||
} else {
|
} else {
|
||||||
tempIcon = 'alpha-e-circle-outline';
|
tempIcon = iconsObj != undefined ? iconsObj["ECO"]["iconName"] : 'alpha-e-circle-outline';
|
||||||
|
tempIconOnColor = iconsObj != undefined ? rgb_dec565(iconsObj["ECO"]["iconOnColor"]) : 2016;
|
||||||
|
tempIconOffColor = iconsObj != undefined ? rgb_dec565(iconsObj["ECO"]["iconOffColor"]) : 35921;
|
||||||
}
|
}
|
||||||
if (getState(id + '.ECO').val && getState(id + '.ECO').val == 1) {
|
if (getState(id + '.ECO').val && getState(id + '.ECO').val == 1) {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'ECO' + '~';
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOnColor + '~1~' + 'ECO' + '~';
|
||||||
statusStr = 'ECO';
|
statusStr = 'ECO';
|
||||||
} else {
|
} else {
|
||||||
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'ECO' + '~';
|
//bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~0~' + 'ECO' + '~'; // bis HMI Fix
|
||||||
|
bt[iconIndex] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~0~' + 'ECO' + '~';
|
||||||
}
|
}
|
||||||
iconIndex++;
|
iconIndex++;
|
||||||
}
|
}
|
||||||
@@ -5325,13 +5354,16 @@ function GenerateThermoPage(page: NSPanel.PageThermo): NSPanel.Payload[] {
|
|||||||
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[7] !== '') {
|
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[7] !== '') {
|
||||||
tempIcon = page.items[0].iconArray[7];
|
tempIcon = page.items[0].iconArray[7];
|
||||||
} else {
|
} else {
|
||||||
tempIcon = 'swap-vertical-bold';
|
tempIcon = iconsObj != undefined ? iconsObj["SWING"]["iconName"] : 'swap-vertical-bold';
|
||||||
|
tempIconOnColor = iconsObj != undefined ? rgb_dec565(iconsObj["SWING"]["iconOnColor"]) : 2016;
|
||||||
|
tempIconOffColor = iconsObj != undefined ? rgb_dec565(iconsObj["SWING"]["iconOffColor"]) : 35921;
|
||||||
}
|
}
|
||||||
if (getState(id + '.POWER').val && getState(id + '.SWING').val == 1) {
|
if (getState(id + '.POWER').val && getState(id + '.SWING').val == 1) {
|
||||||
//0=ON oder .SWING = true
|
//0=ON oder .SWING = true
|
||||||
bt[7] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'SWING' + '~';
|
bt[7] = Icons.GetIcon(tempIcon) + '~' + tempIconOnColor + '~1~' + 'SWING' + '~';
|
||||||
} else {
|
} else {
|
||||||
bt[7] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'SWING' + '~';
|
//bt[7] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~0~' + 'SWING' + '~'; // bis HMI Fix
|
||||||
|
bt[7] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~1~' + 'SWING' + '~';
|
||||||
}
|
}
|
||||||
iconIndex++;
|
iconIndex++;
|
||||||
}
|
}
|
||||||
@@ -5341,13 +5373,16 @@ function GenerateThermoPage(page: NSPanel.PageThermo): NSPanel.Payload[] {
|
|||||||
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[0] !== '') {
|
if (page.items[0].iconArray !== undefined && page.items[0].iconArray[0] !== '') {
|
||||||
tempIcon = page.items[0].iconArray[0];
|
tempIcon = page.items[0].iconArray[0];
|
||||||
} else {
|
} else {
|
||||||
tempIcon = 'power-standby';
|
tempIcon = iconsObj != undefined ? iconsObj["POWER"]["iconName"] : 'power-standby';
|
||||||
|
tempIconOnColor = iconsObj != undefined ? rgb_dec565(iconsObj["POWER"]["iconOnColor"]) : 2016;
|
||||||
|
tempIconOffColor = iconsObj != undefined ? rgb_dec565(iconsObj["POWER"]["iconOffColor"]) : 35921;
|
||||||
}
|
}
|
||||||
if (States[Mode] == 'OFF' || !getState(id + '.POWER').val) {
|
if (States[Mode] == 'OFF' || !getState(id + '.POWER').val) {
|
||||||
bt[0] = Icons.GetIcon(tempIcon) + '~35921~0~' + 'POWER' + '~';
|
//bt[0] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~0~' + 'POWER' + '~'; // bis HMI Fix
|
||||||
|
bt[0] = Icons.GetIcon(tempIcon) + '~' + tempIconOffColor + '~1~' + 'POWER' + '~';
|
||||||
statusStr = 'OFF';
|
statusStr = 'OFF';
|
||||||
} else {
|
} else {
|
||||||
bt[0] = Icons.GetIcon(tempIcon) + '~2016~1~' + 'POWER' + '~';
|
bt[0] = Icons.GetIcon(tempIcon) + '~' + tempIconOnColor + '~1~' + 'POWER' + '~';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11160,6 +11195,7 @@ namespace NSPanel {
|
|||||||
monobutton?: boolean;
|
monobutton?: boolean;
|
||||||
inSel_ChoiceState?: boolean;
|
inSel_ChoiceState?: boolean;
|
||||||
iconArray?: string[];
|
iconArray?: string[];
|
||||||
|
customIcons?: any[];
|
||||||
fontSize?: number;
|
fontSize?: number;
|
||||||
actionStringArray?: string[];
|
actionStringArray?: string[];
|
||||||
alwaysOnDisplay?: boolean;
|
alwaysOnDisplay?: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user