mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-24 15:02:15 +01:00
refactor screensaver
This commit is contained in:
@@ -27,25 +27,6 @@ default_screensaver_color_mapping = {
|
||||
"tTimeAdd": "65535"
|
||||
}
|
||||
|
||||
default_weather_icon_color_mapping = {
|
||||
#"item-per HA" "color in decimal RGB 565 (0-65535)"
|
||||
"clear-night": "35957", #50% grey
|
||||
"cloudy": "31728", #grey-blue
|
||||
"exceptional": "63488", #red
|
||||
"fog": "21130", #75% grey
|
||||
"hail": "65535", #white
|
||||
"lightning": "65120", #golden-yellow
|
||||
"lightning-rainy": "50400", #dark-golden-yellow
|
||||
"partlycloudy": "35957", #50% grey
|
||||
"pouring": "249", #blue
|
||||
"rainy": "33759", #light-blue
|
||||
"snowy": "65535", #white
|
||||
"snowy-rainy": "44479", #light-blue-grey
|
||||
"sunny": "63469", #bright-yellow
|
||||
"windy": "35957", #50% grey
|
||||
"windy-variant": "35957" #50% grey
|
||||
}
|
||||
|
||||
def get_screensaver_color_output(theme, state=None):
|
||||
color_output = "color"
|
||||
for key in default_screensaver_color_mapping:
|
||||
@@ -66,8 +47,6 @@ def map_color(key, theme, state=None):
|
||||
def map_weather_icon_color(key, theme, state):
|
||||
if key in state and state[key] in theme:
|
||||
config_color = rgb_dec565(theme[state[key]])
|
||||
elif key in state and state[key] in default_weather_icon_color_mapping:
|
||||
config_color = default_weather_icon_color_mapping[state[key]]
|
||||
else:
|
||||
config_color = "65535"
|
||||
return config_color
|
||||
|
||||
Reference in New Issue
Block a user