mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-20 14:37:01 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e349d1452 | ||
|
|
8b41bfa066 | ||
|
|
5a93dca172 |
@@ -76,6 +76,7 @@ class LuiBackendConfig(object):
|
|||||||
'sleepBrightness': 20,
|
'sleepBrightness': 20,
|
||||||
'screenBrightness': 100,
|
'screenBrightness': 100,
|
||||||
'sleepTracking': None,
|
'sleepTracking': None,
|
||||||
|
'sleepTrackingZones': ["not_home", "off"],
|
||||||
'sleepOverride': None,
|
'sleepOverride': None,
|
||||||
'locale': "en_US",
|
'locale': "en_US",
|
||||||
'timeFormat': "%H:%M",
|
'timeFormat': "%H:%M",
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class LuiController(object):
|
|||||||
sleepBrightness = 0
|
sleepBrightness = 0
|
||||||
brightness = self.calc_current_brightness(self._config.get("screenBrightness"))
|
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")
|
self._ha_api.log(f"sleepTracking setting brightness to 0")
|
||||||
sleepBrightness = 0
|
sleepBrightness = 0
|
||||||
|
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class LuiPagesGen(object):
|
|||||||
if item.status is not None and self._ha_api.entity_exists(item.status):
|
if item.status is not None and self._ha_api.entity_exists(item.status):
|
||||||
status_entity = self._ha_api.get_entity(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_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":
|
if item.status.startswith("sensor") and cardType == "cardGrid":
|
||||||
icon_res = status_entity.state[:4]
|
icon_res = status_entity.state[:4]
|
||||||
if icon_res[-1] == ".":
|
if icon_res[-1] == ".":
|
||||||
|
|||||||
@@ -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.
|
`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.
|
`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.
|
`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.
|
`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.
|
`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
|
`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