mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-22 15:34:26 +01:00
Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui
This commit is contained in:
@@ -24,7 +24,14 @@ class LuiPagesGen(object):
|
|||||||
|
|
||||||
def get_entity_color(self, entity, overwrite=None):
|
def get_entity_color(self, entity, overwrite=None):
|
||||||
if overwrite is not None:
|
if overwrite is not None:
|
||||||
return rgb_dec565(overwrite)
|
if type(overwrite) is list:
|
||||||
|
return rgb_dec565(overwrite)
|
||||||
|
if type(overwrite) is dict:
|
||||||
|
state = entity.state
|
||||||
|
for overwrite_state, overwrite_val in overwrite.items():
|
||||||
|
if overwrite_state == state:
|
||||||
|
return rgb_dec565(overwrite_val)
|
||||||
|
|
||||||
attr = entity.attributes
|
attr = entity.attributes
|
||||||
default_color_on = rgb_dec565([253, 216, 53])
|
default_color_on = rgb_dec565([253, 216, 53])
|
||||||
default_color_off = rgb_dec565([68, 115, 158])
|
default_color_off = rgb_dec565([68, 115, 158])
|
||||||
|
|||||||
@@ -36,6 +36,14 @@ It is also possible to configure different icon overwrites per state:
|
|||||||
"off": mdi:lightbulb
|
"off": mdi:lightbulb
|
||||||
```
|
```
|
||||||
|
|
||||||
|
It is also possible to configure different color overwrites per state:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
color:
|
||||||
|
"on": [255,0,0]
|
||||||
|
"off": [0,0,255]
|
||||||
|
```
|
||||||
|
|
||||||
It is also possible to use text instead of icons with `text:X`
|
It is also possible to use text instead of icons with `text:X`
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
Reference in New Issue
Block a user