mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-21 15:04:24 +01:00
enable val_best to be used for switching colors of boolean state
This commit is contained in:
@@ -7377,7 +7377,8 @@ function GetScreenSaverEntityColor(configElement: ScreenSaverElement | null): nu
|
||||
let colorReturn: any;
|
||||
if (configElement.ScreensaverEntityIconColor != undefined) {
|
||||
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') {
|
||||
let iconvalmin = (configElement.ScreensaverEntityIconColor.val_min != undefined) ? configElement.ScreensaverEntityIconColor.val_min : 0 ;
|
||||
let iconvalmax = (configElement.ScreensaverEntityIconColor.val_max != undefined) ? configElement.ScreensaverEntityIconColor.val_max : 100 ;
|
||||
|
||||
@@ -6865,7 +6865,8 @@ function GetScreenSaverEntityColor(configElement: ScreenSaverElement | null): nu
|
||||
let colorReturn: any;
|
||||
if (configElement.ScreensaverEntityIconColor != undefined) {
|
||||
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') {
|
||||
let iconvalmin = (configElement.ScreensaverEntityIconColor.val_min != undefined) ? configElement.ScreensaverEntityIconColor.val_min : 0 ;
|
||||
let iconvalmax = (configElement.ScreensaverEntityIconColor.val_max != undefined) ? configElement.ScreensaverEntityIconColor.val_max : 100 ;
|
||||
|
||||
Reference in New Issue
Block a user