Compare commits

..

3 Commits

Author SHA1 Message Date
Johannes
8e349d1452 fix #379 2022-08-01 19:49:27 +02:00
Johannes
8b41bfa066 Update config-overview.md 2022-08-01 18:15:56 +02:00
Johannes
5a93dca172 implements #380 2022-08-01 18:14:53 +02:00
4 changed files with 4 additions and 2 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

@@ -179,7 +179,7 @@ class LuiPagesGen(object):
if item.status is not None and self._ha_api.entity_exists(item.status):
status_entity = self._ha_api.get_entity(item.status)
icon_res = get_icon_id_ha(item.status.split(".")[0], state=status_entity.state, device_class=status_entity.attributes.get("device_class", "_"), overwrite=icon)
icon_color = self.get_entity_color(entity, overwrite=colorOverride)
icon_color = self.get_entity_color(status_entity, overwrite=colorOverride)
if item.status.startswith("sensor") and cardType == "cardGrid":
icon_res = status_entity.state[:4]
if icon_res[-1] == ".":

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