Compare commits

..

1 Commits

Author SHA1 Message Date
slajob
685555f5ba Merge 127671047f into 8d21c653ae 2024-02-06 21:00:20 +01:00
2 changed files with 12 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config # https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
name: NSPanel Lovelace UI Addon name: NSPanel Lovelace UI Addon
version: "4.7.77" version: "4.7.74"
slug: nspanel-lovelace-ui slug: nspanel-lovelace-ui
description: NSPanel Lovelace UI Addon description: NSPanel Lovelace UI Addon
services: services:

View File

@@ -20,32 +20,27 @@ def calculate_dim_values(sleepTracking, sleepTrackingZones, sleepBrightness, scr
dimmode = sleepBrightness dimmode = sleepBrightness
elif isinstance(sleepBrightness, list): elif isinstance(sleepBrightness, list):
logging.error("list style config for sleepBrightness no longer supported") logging.error("list style config for sleepBrightness no longer supported")
#elif sleepBrightness.startswith("ha:"): elif sleepBrightness.startswith("ha:"):
# time.sleep(1) time.sleep(1)
# dimmode = int(float(libs.home_assistant.get_template(sleepBrightness)[3:])) dimmode = int(float(libs.home_assistant.get_template(sleepBrightness)[3:]))
# involved_entities.extend(libs.home_assistant.get_template_listener_entities(sleepBrightness)) involved_entities.extend(libs.home_assistant.get_template_listener_entities(sleepBrightness))
elif libs.home_assistant.is_existent(sleepBrightness): elif libs.home_assistant.is_existent(sleepBrightness):
involved_entities.append(sleepBrightness) involved_entities.append(sleepBrightness)
try:
dimmode = int(float(libs.home_assistant.get_entity_data(sleepBrightness).get('state', 10))) dimmode = int(float(libs.home_assistant.get_entity_data(sleepBrightness).get('state', 10)))
except ValueError:
print("sleepBrightness entity invalid")
if screenBrightness: if screenBrightness:
if isinstance(screenBrightness, int): if isinstance(screenBrightness, int):
dimValueNormal = screenBrightness dimValueNormal = screenBrightness
elif isinstance(screenBrightness, list): elif isinstance(screenBrightness, list):
logging.error("list style config for screenBrightness no longer supported") logging.error("list style config for screenBrightness no longer supported")
#elif screenBrightness.startswith("ha:"): elif screenBrightness.startswith("ha:"):
# time.sleep(1) time.sleep(1)
# dimValueNormal = int(float(libs.home_assistant.get_template(screenBrightness)[3:])) dimValueNormal = int(float(libs.home_assistant.get_template(screenBrightness)[3:]))
# involved_entities.extend(libs.home_assistant.get_template_listener_entities(screenBrightness)) involved_entities.extend(libs.home_assistant.get_template_listener_entities(screenBrightness))
elif libs.home_assistant.is_existent(screenBrightness): elif libs.home_assistant.is_existent(screenBrightness):
involved_entities.append(screenBrightness) involved_entities.append(screenBrightness)
try:
dimValueNormal = int(float(libs.home_assistant.get_entity_data(screenBrightness).get('state', 100))) dimValueNormal = int(float(libs.home_assistant.get_entity_data(screenBrightness).get('state', 100)))
except ValueError:
print("screenBrightness entity invalid")
# force sleep brightness to zero in case sleepTracking is active # force sleep brightness to zero in case sleepTracking is active
if sleepTracking: if sleepTracking:
if libs.home_assistant.is_existent(sleepTracking): if libs.home_assistant.is_existent(sleepTracking):