mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-23 16:04:25 +01:00
closes #302 added config option
This commit is contained in:
BIN
HMI/nspanel.HMI
BIN
HMI/nspanel.HMI
Binary file not shown.
BIN
HMI/nspanel.tft
BIN
HMI/nspanel.tft
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user