enable val_best to be used for switching colors of boolean state

This commit is contained in:
Oliver
2023-03-05 22:01:11 +01:00
parent fe401cc7c2
commit ff0fa19431
2 changed files with 4 additions and 2 deletions

View File

@@ -7377,7 +7377,8 @@ function GetScreenSaverEntityColor(configElement: ScreenSaverElement | null): nu
let colorReturn: any; let colorReturn: any;
if (configElement.ScreensaverEntityIconColor != undefined) { if (configElement.ScreensaverEntityIconColor != undefined) {
if (typeof getState(configElement.ScreensaverEntity).val == 'boolean') { if (typeof getState(configElement.ScreensaverEntity).val == 'boolean') {
colorReturn = (getState(configElement.ScreensaverEntity).val == true) ? rgb_dec565(colorScale10) : rgb_dec565(colorScale0); let iconvalbest = (configElement.ScreensaverEntityIconColor.val_best != undefined) ? configElement.ScreensaverEntityIconColor.val_best : false ;
colorReturn = (getState(configElement.ScreensaverEntity).val == iconvalbest) ? rgb_dec565(colorScale0) : rgb_dec565(colorScale10);
} else if (typeof configElement.ScreensaverEntityIconColor == 'object') { } else if (typeof configElement.ScreensaverEntityIconColor == 'object') {
let iconvalmin = (configElement.ScreensaverEntityIconColor.val_min != undefined) ? configElement.ScreensaverEntityIconColor.val_min : 0 ; let iconvalmin = (configElement.ScreensaverEntityIconColor.val_min != undefined) ? configElement.ScreensaverEntityIconColor.val_min : 0 ;
let iconvalmax = (configElement.ScreensaverEntityIconColor.val_max != undefined) ? configElement.ScreensaverEntityIconColor.val_max : 100 ; let iconvalmax = (configElement.ScreensaverEntityIconColor.val_max != undefined) ? configElement.ScreensaverEntityIconColor.val_max : 100 ;

View File

@@ -6865,7 +6865,8 @@ function GetScreenSaverEntityColor(configElement: ScreenSaverElement | null): nu
let colorReturn: any; let colorReturn: any;
if (configElement.ScreensaverEntityIconColor != undefined) { if (configElement.ScreensaverEntityIconColor != undefined) {
if (typeof getState(configElement.ScreensaverEntity).val == 'boolean') { if (typeof getState(configElement.ScreensaverEntity).val == 'boolean') {
colorReturn = (getState(configElement.ScreensaverEntity).val == true) ? rgb_dec565(colorScale10) : rgb_dec565(colorScale0); let iconvalbest = (configElement.ScreensaverEntityIconColor.val_best != undefined) ? configElement.ScreensaverEntityIconColor.val_best : false ;
colorReturn = (getState(configElement.ScreensaverEntity).val == iconvalbest) ? rgb_dec565(colorScale0) : rgb_dec565(colorScale10);
} else if (typeof configElement.ScreensaverEntityIconColor == 'object') { } else if (typeof configElement.ScreensaverEntityIconColor == 'object') {
let iconvalmin = (configElement.ScreensaverEntityIconColor.val_min != undefined) ? configElement.ScreensaverEntityIconColor.val_min : 0 ; let iconvalmin = (configElement.ScreensaverEntityIconColor.val_min != undefined) ? configElement.ScreensaverEntityIconColor.val_min : 0 ;
let iconvalmax = (configElement.ScreensaverEntityIconColor.val_max != undefined) ? configElement.ScreensaverEntityIconColor.val_max : 100 ; let iconvalmax = (configElement.ScreensaverEntityIconColor.val_max != undefined) ? configElement.ScreensaverEntityIconColor.val_max : 100 ;