closes #302 added config option

This commit is contained in:
Johannes
2022-07-09 11:14:03 +02:00
parent f0773f9026
commit 69c2f1d8d3
4 changed files with 15 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

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

View File

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