HI,
having several hardcoded colors in my python scripts, I am exploring the possibility to use the theme variable names, var(–background-color) etc etc.
right now I have a script using this:
familyColor = ['grey', # count_home = 0 #808080
'steelblue', # = 1
'saddlebrown', # = 2 #00f
'gold', # = 3 #fbd229
'darkorange', # = 4 #ff8700
'red', # = 5 #ff0f00
'green'] # = 6
and using that to color the icon:
icon_color = familyColor[count_home%len(familyColor)]
hass.states.set('sensor.family_home', count_home, {
'friendly_name': 'Family Home?',
'home': ', '.join(home),
'away': ', '.join(away),
'icon': whichIcon,
'count_home': count_home,
'count_away': count_away,
'family_count': familyCount,
'icon_color': icon_color,
'show_last_changed': 'true'
})
Havent been lucky replacing the color names with the theme variables though…
can this be done? please have a look, thanks