This commit is contained in:
joBr99
2022-08-01 18:14:53 +02:00
parent 6c854902b6
commit b448cea847
3 changed files with 3 additions and 1 deletions

View File

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

View File

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

View File

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