mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-22 15:34:26 +01:00
implements #380
This commit is contained in:
@@ -76,6 +76,7 @@ class LuiBackendConfig(object):
|
||||
'sleepBrightness': 20,
|
||||
'screenBrightness': 100,
|
||||
'sleepTracking': None,
|
||||
'sleepTrackingZones': ["not_home", "off"],
|
||||
'sleepOverride': None,
|
||||
'locale': "en_US",
|
||||
'timeFormat': "%H:%M",
|
||||
|
||||
@@ -95,7 +95,7 @@ class LuiController(object):
|
||||
sleepBrightness = 0
|
||||
brightness = self.calc_current_brightness(self._config.get("screenBrightness"))
|
||||
|
||||
if bst is not None and self._ha_api.entity_exists(bst) and self._ha_api.get_entity(bst).state in ["not_home", "off"]:
|
||||
if bst is not None and self._ha_api.entity_exists(bst) and self._ha_api.get_entity(bst).state in self._config.get("sleepTrackingZones"):
|
||||
self._ha_api.log(f"sleepTracking setting brightness to 0")
|
||||
sleepBrightness = 0
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ key | optional | type | default | description
|
||||
`sleepBrightness` | True | integer/complex | `20` | Brightness for the screen on the screensaver, see example below for complex/scheduled config.
|
||||
`screenBrightness` | True | integer/complex | `100` | Brightness for the screen during usage, config format is the same as sleepBrightness.
|
||||
`sleepTracking` | True | string | None | Forces screensaver brightness to 0 in case entity state is not_home or off, can be a group, person or device_tracker entity.
|
||||
`sleepTrackingZones` | True | list | `["not_home", "off"]` | Allows you to set your own stats for sleepTracking
|
||||
`sleepOverride` | True | complex | None | Allows overriding of the sleepBrightness if entity state is on, true or home. Overrides sleepBrightness but sleepTracking takes precedence.
|
||||
`locale` | True | string | `en_US` | Used by babel to determinante Date format on screensaver, also used for localization.
|
||||
`dateFormatBabel` | True | string | `full` | formatting options on https://babel.pocoo.org/en/latest/dates.html?highlight=name%20of%20day#date-fields
|
||||
|
||||
Reference in New Issue
Block a user