v4.0.5.11

light 'hue' and light 'rgb' have '.TEMPERATURE' optional
This commit is contained in:
Thomas
2023-04-28 18:28:49 +02:00
parent fb3920de32
commit 9eff7a59f8
2 changed files with 29 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
/*-----------------------------------------------------------------------
TypeScript v4.0.5.10 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom
TypeScript v4.0.5.11 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom
- abgestimmt auf TFT 50 / v4.0.5 / BerryDriver 8 / Tasmota 12.5.0
@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
@@ -133,7 +133,8 @@ ReleaseNotes:
- 18.04.2023 - v4.0.5.7 Fix Function check_updates
- 20.04.2023 - v4.0.5.8 Fix Layout Update message for TFT, Berry-Driver and Tasmota
- 21.04.2023 - v4.0.5.9 Add Parameter pageitem id0 to ActivePages (0_userdata)
- 23.04.2023 - v4.0.5.10 v4.0.5.10 Fixed error wrong icon index in GeneratePowerPage by fre4242
- 23.04.2023 - v4.0.5.10 Fixed error wrong icon index in GeneratePowerPage by fre4242
- 28.04.2023 - v4.0.5.11 light 'hue' and light 'rgb' have '.TEMPERATURE' optional
***********************************************************************************************************
* Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObect" gesetzt sein! *
@@ -1218,11 +1219,11 @@ export const config = <Config> {
mrIcon1ScreensaverEntity:
{
ScreensaverEntity: NSPanel_Path + 'Relay.1',
ScreensaverEntityIconOn: 'lightbulb', //Rename
ScreensaverEntityIconOn: 'lightbulb',
ScreensaverEntityIconOff: null,
ScreensaverEntityValue: null, //New
ScreensaverEntityValueDecimalPlace : 0, //New
ScreensaverEntityValueUnit: null, //New
ScreensaverEntityValue: null,
ScreensaverEntityValueDecimalPlace : 0,
ScreensaverEntityValueUnit: null,
ScreensaverEntityOnColor: On,
ScreensaverEntityOffColor: HMIOff
},
@@ -6216,9 +6217,9 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//RegisterDetailEntityWatcher(id + '.HUE', pageItem, type);
}
}
let colorTemp = 0;
let colorTemp: any;
if (existsState(id + '.TEMPERATURE')) {
colorTemp = 0;
if (getState(id + '.TEMPERATURE').val != null) {
if (pageItem.minValueColorTemp !== undefined && pageItem.maxValueColorTemp !== undefined) {
colorTemp = Math.trunc(scale(getState(id + '.TEMPERATURE').val, pageItem.minValueColorTemp, pageItem.maxValueColorTemp, 100, 0));
@@ -6228,7 +6229,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//RegisterDetailEntityWatcher(id + '.TEMPERATURE', pageItem, type);
}
} else {
console.warn('function GenerateDetailPage role:hue -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
colorTemp = 'disable';
//console.warn('function GenerateDetailPage role:hue -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
out_msgs.push({
@@ -6281,9 +6283,9 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//RegisterDetailEntityWatcher(id + '.HUE', pageItem, type);
}
}
let colorTemp = 0;
let colorTemp: any;
if (existsState(id + '.TEMPERATURE')) {
colorTemp = 0;
if (getState(id + '.TEMPERATURE').val != null) {
if (pageItem.minValueColorTemp !== undefined && pageItem.minValueColorTemp !== undefined) {
colorTemp = Math.trunc(scale(getState(id + '.TEMPERATURE').val, pageItem.minValueColorTemp, pageItem.maxValueColorTemp, 100, 0));
@@ -6293,7 +6295,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//RegisterDetailEntityWatcher(id + '.TEMPERATURE', pageItem, type);
}
} else {
console.warn('function GenerateDetailPage role:rgb -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
colorTemp = 'disable';
//console.warn('function GenerateDetailPage role:rgb -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
out_msgs.push({

View File

@@ -1,5 +1,5 @@
/*-----------------------------------------------------------------------
TypeScript v4.0.5.10 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom
TypeScript v4.0.5.11 zur Steuerung des SONOFF NSPanel mit dem ioBroker by @Armilar / @Sternmiere / @Britzelpuf / @ravenS0ne / @TT-Tom
- abgestimmt auf TFT 50 / v4.0.5 / BerryDriver 8 / Tasmota 12.5.0
@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
@@ -133,7 +133,8 @@ ReleaseNotes:
- 18.04.2023 - v4.0.5.7 Fix Function check_updates
- 20.04.2023 - v4.0.5.8 Fix Layout Update message for TFT, Berry-Driver and Tasmota
- 21.04.2023 - v4.0.5.9 Add Parameter pageitem id0 to ActivePages (0_userdata)
- 21.04.2023 - v4.0.5.10 Fixed error wrong icon index in GeneratePowerPage by fre4242
- 23.04.2023 - v4.0.5.10 Fixed error wrong icon index in GeneratePowerPage by fre4242
- 28.04.2023 - v4.0.5.11 light 'hue' and light 'rgb' have '.TEMPERATURE' optional
***********************************************************************************************************
* Für die Erstellung der Aliase durch das Skript, muss in der JavaScript Instanz "setObect" gesetzt sein! *
@@ -5717,9 +5718,9 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//RegisterDetailEntityWatcher(id + '.HUE', pageItem, type);
}
}
let colorTemp = 0;
let colorTemp: any;
if (existsState(id + '.TEMPERATURE')) {
colorTemp = 0;
if (getState(id + '.TEMPERATURE').val != null) {
if (pageItem.minValueColorTemp !== undefined && pageItem.maxValueColorTemp !== undefined) {
colorTemp = Math.trunc(scale(getState(id + '.TEMPERATURE').val, pageItem.minValueColorTemp, pageItem.maxValueColorTemp, 100, 0));
@@ -5729,7 +5730,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//RegisterDetailEntityWatcher(id + '.TEMPERATURE', pageItem, type);
}
} else {
console.warn('function GenerateDetailPage role:hue -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
colorTemp = 'disable';
//console.warn('function GenerateDetailPage role:hue -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
out_msgs.push({
@@ -5782,9 +5784,9 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//RegisterDetailEntityWatcher(id + '.HUE', pageItem, type);
}
}
let colorTemp = 0;
let colorTemp: any;
if (existsState(id + '.TEMPERATURE')) {
colorTemp = 0;
if (getState(id + '.TEMPERATURE').val != null) {
if (pageItem.minValueColorTemp !== undefined && pageItem.minValueColorTemp !== undefined) {
colorTemp = Math.trunc(scale(getState(id + '.TEMPERATURE').val, pageItem.minValueColorTemp, pageItem.maxValueColorTemp, 100, 0));
@@ -5794,7 +5796,8 @@ function GenerateDetailPage(type: string, optional: string, pageItem: PageItem):
//RegisterDetailEntityWatcher(id + '.TEMPERATURE', pageItem, type);
}
} else {
console.warn('function GenerateDetailPage role:rgb -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
colorTemp = 'disable';
//console.warn('function GenerateDetailPage role:rgb -> Alias-Datenpunkt: ' + id + '.TEMPERATURE could not be read');
}
out_msgs.push({