diff --git a/HMI/nspanel.HMI b/HMI/nspanel.HMI index bd56acb2..e2974a8e 100644 Binary files a/HMI/nspanel.HMI and b/HMI/nspanel.HMI differ diff --git a/HMI/nspanel.tft b/HMI/nspanel.tft index 9ed2e681..3a3b3ac5 100644 Binary files a/HMI/nspanel.tft and b/HMI/nspanel.tft differ diff --git a/apps/nspanel-lovelace-ui/luibackend/controller.py b/apps/nspanel-lovelace-ui/luibackend/controller.py index 96d245c7..4f35b4f1 100644 --- a/apps/nspanel-lovelace-ui/luibackend/controller.py +++ b/apps/nspanel-lovelace-ui/luibackend/controller.py @@ -1,5 +1,5 @@ import datetime -from helper import scale, pos_to_color +from helper import scale, pos_to_color, rgb_dec565 from pages import LuiPagesGen @@ -111,7 +111,19 @@ class LuiController(object): # same value for both values will break sleep timer of the firmware if sleepBrightness==brightness: sleepBrightness = sleepBrightness-1 - self._send_mqtt_msg(f"dimmode~{sleepBrightness}~{brightness}") + + # background color + dbc = 0 + defaultBackgroundColor = self._config.get("defaultBackgroundColor") + if type(defaultBackgroundColor) is str: + if defaultBackgroundColor == "ha-dark": + dbc = 6371 + elif defaultBackgroundColor == "black": + dbc = 0 + elif type(defaultBackgroundColor) is list: + dbc = rgb_dec565(defaultBackgroundColor) + + self._send_mqtt_msg(f"dimmode~{sleepBrightness}~{brightness}~{dbc}") def calc_current_brightness(self, sleep_brightness_config): current_screensaver_brightness = 20 diff --git a/docs/config-overview.md b/docs/config-overview.md index 4e002fd7..6c598864 100644 --- a/docs/config-overview.md +++ b/docs/config-overview.md @@ -65,6 +65,7 @@ key | optional | type | default | description `dateAdditionalTemplate` | True | string | `""` | Addional Text dispayed after Date, can contain a Homeassistant Template Example `" - {{ states('sun.sun') }}"` `timeAdditionalTemplate` | True | string | `""` | Addional Text dispayed below Time, can contain a Homeassistant Template `dateFormat` | True | string | `%A, %d. %B %Y` | date format used if babel is not installed +`defaultBackgroundColor` | True | string | ha-dark | backgroud color of all cards, valid values: `black`, `ha-dark` `cards` | False | complex | | configuration for cards that are displayed on panel; see docs for cards `screensaver` | True | complex | | configuration for screensaver; see docs for screensaver `hiddenCards` | True | complex | | configuration for cards that can be accessed though navigate items; see docs for cards