This commit is contained in:
Johannes
2022-07-23 16:02:21 +02:00
2 changed files with 16 additions and 1 deletions

View File

@@ -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:
if type(overwrite) is list:
return rgb_dec565(overwrite) 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])

View File

@@ -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