From c915bda9b94896a8016f69436a1b4b2af7cf9432 Mon Sep 17 00:00:00 2001 From: Benjamin Auquite Date: Mon, 3 Apr 2023 01:57:12 -0500 Subject: [PATCH] Autoreset_Control_Time - small changes (#515) * small changes * Update README.md * trivial comment change --------- Co-authored-by: github-actions[bot] Co-authored-by: Bas Nijholt --- README.md | 2 +- custom_components/adaptive_lighting/const.py | 2 +- custom_components/adaptive_lighting/switch.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6c03f1f7..037a6b05 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ The YAML and frontend configuration methods support all of the options listed be | `separate_turn_on_commands` | Use separate `light.turn_on` calls for color and brightness, needed for some light types. 🔀 | `False` | `bool` | | `send_split_delay` | Wait time (milliseconds) between commands when using `separate_turn_on_commands`. Helps ensure correct handling. ⏲️ | `0` | `int` 0-10000 | | `adapt_delay` | Wait time (seconds) between light turn on and Adaptive Lighting applying changes. Helps avoid flickering. ⏲️ | `0` | `float > 0` | -| `autoreset_control_seconds` | Automatically reset the manual control after a number of seconds. Set to 0 to disable. ⏲️ | `0` | `int` 0-604800 | +| `autoreset_control_seconds` | Automatically reset the manual control after a number of seconds. Set to 0 to disable. ⏲️ | `0` | `int` 0-31536000 | diff --git a/custom_components/adaptive_lighting/const.py b/custom_components/adaptive_lighting/const.py index eb29fa13..471d593c 100644 --- a/custom_components/adaptive_lighting/const.py +++ b/custom_components/adaptive_lighting/const.py @@ -228,7 +228,7 @@ VALIDATION_TUPLES = [ ( CONF_AUTORESET_CONTROL, DEFAULT_AUTORESET_CONTROL, - int_between(0, 7 * 24 * 60 * 60), # 7 days max + int_between(0, 365 * 24 * 60 * 60), # 1 year max ), ] diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 5cf17122..6527b73d 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -822,6 +822,7 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): self._adapt_delay = data[CONF_ADAPT_DELAY] self._send_split_delay = data[CONF_SEND_SPLIT_DELAY] self._auto_reset_manual_control_time = data[CONF_AUTORESET_CONTROL] + self._expand_light_groups() # updates manual control timers _loc = get_astral_location(self.hass) if isinstance(_loc, tuple): # Astral v2.2