From df2c83c4904290c8a43c22cc6007f51b0ebaad63 Mon Sep 17 00:00:00 2001 From: Benjamin Auquite Date: Mon, 3 Apr 2023 16:22:32 -0500 Subject: [PATCH 1/5] Update const.py --- custom_components/adaptive_lighting/const.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/adaptive_lighting/const.py b/custom_components/adaptive_lighting/const.py index bb0c07cd..2652e85e 100644 --- a/custom_components/adaptive_lighting/const.py +++ b/custom_components/adaptive_lighting/const.py @@ -44,24 +44,24 @@ DOCS[CONF_INCLUDE_CONFIG_IN_ATTRIBUTES] = ( "Home Assistant when set to `true`. 📝" ) -CONF_INITIAL_TRANSITION, DEFAULT_INITIAL_TRANSITION = "initial_transition", 1 +CONF_INITIAL_TRANSITION, DEFAULT_INITIAL_TRANSITION = "initial_transition", 120 DOCS[CONF_INITIAL_TRANSITION] = ( "Duration of the first transition when lights turn " "from `off` to `on` in seconds. ⏲️" ) -CONF_SLEEP_TRANSITION, DEFAULT_SLEEP_TRANSITION = "sleep_transition", 1 +CONF_SLEEP_TRANSITION, DEFAULT_SLEEP_TRANSITION = "sleep_transition", 15 DOCS[CONF_SLEEP_TRANSITION] = ( "Duration of transition when 'sleep mode' is toggled " "in seconds. 😴" ) -CONF_INTERVAL, DEFAULT_INTERVAL = "interval", 90 +CONF_INTERVAL, DEFAULT_INTERVAL = "interval", 5 DOCS[CONF_INTERVAL] = "Frequency to adapt the lights, in seconds. 🔄" CONF_MAX_BRIGHTNESS, DEFAULT_MAX_BRIGHTNESS = "max_brightness", 100 DOCS[CONF_MAX_BRIGHTNESS] = "Maximum brightness percentage. 💡" -CONF_MAX_COLOR_TEMP, DEFAULT_MAX_COLOR_TEMP = "max_color_temp", 5500 +CONF_MAX_COLOR_TEMP, DEFAULT_MAX_COLOR_TEMP = "max_color_temp", 6500 DOCS[CONF_MAX_COLOR_TEMP] = "Coldest color temperature in Kelvin. ❄️" CONF_MIN_BRIGHTNESS, DEFAULT_MIN_BRIGHTNESS = "min_brightness", 1 From 8c21f038510700a2b07bebd3ba8197a90a37f00a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 3 Apr 2023 21:25:13 +0000 Subject: [PATCH 2/5] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5b98de8b..e43a0e9e 100644 --- a/README.md +++ b/README.md @@ -93,15 +93,15 @@ The YAML and frontend configuration methods support all of the options listed be | `lights` | List of light entities to be controlled by Adaptive Lighting (may be empty). 🌟 | `[]` | list of `entity_id`s | | `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | `False` | `bool` | | `include_config_in_attributes` | Show all options as attributes on the switch in Home Assistant when set to `true`. 📝 | `False` | `bool` | -| `initial_transition` | Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️ | `1` | `float` 0-6553 | -| `sleep_transition` | Duration of transition when 'sleep mode' is toggled in seconds. 😴 | `1` | `float` 0-6553 | +| `initial_transition` | Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️ | `120` | `float` 0-6553 | +| `sleep_transition` | Duration of transition when 'sleep mode' is toggled in seconds. 😴 | `15` | `float` 0-6553 | | `transition` | Duration of transition when lights change, in seconds. 🕑 | `45` | `float` 0-6553 | | `transition_until_sleep` | When enabled, Adaptive Lighting will treat sleep settings as the minimum, transitioning to these values after sunset. 🌙 | `False` | `bool` | -| `interval` | Frequency to adapt the lights, in seconds. 🔄 | `90` | `int > 0` | +| `interval` | Frequency to adapt the lights, in seconds. 🔄 | `5` | `int > 0` | | `min_brightness` | Minimum brightness percentage. 💡 | `1` | `int` 1-100 | | `max_brightness` | Maximum brightness percentage. 💡 | `100` | `int` 1-100 | | `min_color_temp` | Warmest color temperature in Kelvin. 🔥 | `2000` | `int` 1000-10000 | -| `max_color_temp` | Coldest color temperature in Kelvin. ❄️ | `5500` | `int` 1000-10000 | +| `max_color_temp` | Coldest color temperature in Kelvin. ❄️ | `6500` | `int` 1000-10000 | | `sleep_brightness` | Brightness percentage of lights in sleep mode. 😴 | `1` | `int` 1-100 | | `sleep_rgb_or_color_temp` | Use either `'rgb_color'` or `'color_temp'` in sleep mode. 🌙 | `color_temp` | one of `['color_temp', 'rgb_color']` | | `sleep_color_temp` | Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴 | `1000` | `int` 1000-10000 | From 152637dd34d5666bcf707c141dcd89ca0c75e9d7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 4 Apr 2023 00:50:38 +0000 Subject: [PATCH 3/5] Update README.md, strings.json, and services.yaml --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 646c644c..386d8ecd 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,38 @@ The YAML and frontend configuration methods support all of the options listed be +| Variable name | Description | Default | Type | +|:-------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------|:-------------------------------------| +| `lights` | List of light entity_ids to be controlled (may be empty). 🌟 | `[]` | list of `entity_id`s | +| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | `False` | `bool` | +| `include_config_in_attributes` | Show all options as attributes on the switch in Home Assistant when set to `true`. 📝 | `False` | `bool` | +| `initial_transition` | Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️ | `120` | `float` 0-6553 | +| `sleep_transition` | Duration of transition when "sleep mode" is toggled in seconds. 😴 | `15` | `float` 0-6553 | +| `transition` | Duration of transition when lights change, in seconds. 🕑 | `45` | `float` 0-6553 | +| `transition_until_sleep` | When enabled, Adaptive Lighting will treat sleep settings as the minimum, transitioning to these values after sunset. 🌙 | `False` | `bool` | +| `interval` | Frequency to adapt the lights, in seconds. 🔄 | `5` | `int > 0` | +| `min_brightness` | Minimum brightness percentage. 💡 | `1` | `int` 1-100 | +| `max_brightness` | Maximum brightness percentage. 💡 | `100` | `int` 1-100 | +| `min_color_temp` | Warmest color temperature in Kelvin. 🔥 | `2000` | `int` 1000-10000 | +| `max_color_temp` | Coldest color temperature in Kelvin. ❄️ | `6500` | `int` 1000-10000 | +| `sleep_brightness` | Brightness percentage of lights in sleep mode. 😴 | `1` | `int` 1-100 | +| `sleep_rgb_or_color_temp` | Use either `"rgb_color"` or `"color_temp"` in sleep mode. 🌙 | `color_temp` | one of `['color_temp', 'rgb_color']` | +| `sleep_color_temp` | Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴 | `1000` | `int` 1000-10000 | +| `sleep_rgb_color` | RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is "rgb_color"). 🌈 | `[255, 56, 0]` | RGB color | +| `sunrise_time` | Set a fixed time (HH:MM:SS) for sunrise. 🌅 | `None` | `str` | +| `max_sunrise_time` | Set the latest virtual sunrise time (HH:MM:SS), allowing for earlier real sunrises. 🌅 | `None` | `str` | +| `sunrise_offset` | Adjust sunrise time with a positive or negative offset in seconds. ⏰ | `0` | `int` | +| `sunset_time` | Set a fixed time (HH:MM:SS) for sunset. 🌇 | `None` | `str` | +| `min_sunset_time` | Set the earliest virtual sunset time (HH:MM:SS), allowing for later real sunsets. 🌇 | `None` | `str` | +| `sunset_offset` | Adjust sunset time with a positive or negative offset in seconds. ⏰ | `0` | `int` | +| `only_once` | Adapt lights only when they are turned on (`true`) or keep adapting them (`false`). 🔄 | `False` | `bool` | +| `take_over_control` | Disable Adaptive Lighting if another source calls `light.turn_on` while lights are on and being adapted. Note that this calls `homeassistant.update_entity` every `interval`! 🔒 | `True` | `bool` | +| `detect_non_ha_changes` | Detect non-`light.turn_on` state changes and stop adapting lights. Requires `take_over_control`. 🕵️ | `False` | `bool` | +| `separate_turn_on_commands` | Use separate `light.turn_on` calls for color and brightness, needed for some light types. 🔀 | `False` | `bool` | +| `send_split_delay` | Delay (ms) between `separate_turn_on_commands` for lights that don't support simultaneous brightness and color setting. ⏲️ | `0` | `int` 0-10000 | +| `adapt_delay` | Wait time (seconds) between light turn on and Adaptive Lighting applying changes. Might help to 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-31536000 | + Full example: From 4f5305e16a5fde6f766a5d9c1979f8732ff684c6 Mon Sep 17 00:00:00 2001 From: Benjamin Auquite Date: Wed, 12 Apr 2023 00:55:08 -0500 Subject: [PATCH 4/5] Delete services.yaml --- .../adaptive_lighting/services.yaml | 251 ------------------ 1 file changed, 251 deletions(-) delete mode 100755 custom_components/adaptive_lighting/services.yaml diff --git a/custom_components/adaptive_lighting/services.yaml b/custom_components/adaptive_lighting/services.yaml deleted file mode 100755 index cd25811b..00000000 --- a/custom_components/adaptive_lighting/services.yaml +++ /dev/null @@ -1,251 +0,0 @@ -# This file is auto-generated by .github/update-services.py. -apply: - description: Applies the current Adaptive Lighting settings to lights. - fields: - entity_id: - description: The `entity_id` of the switch with the settings to apply. 📝 - selector: - entity: - integration: adaptive_lighting - domain: switch - multiple: false - lights: - description: A light (or list of lights) to apply the settings to. 💡 - selector: - entity: - domain: light - multiple: true - transition: - description: Duration of transition when lights change, in seconds. 🕑 - example: 10 - selector: - text: null - adapt_brightness: - description: Whether to adapt the brightness of the light. 🌞 - example: true - selector: - boolean: null - adapt_color: - description: Whether to adapt the color on supporting lights. 🌈 - example: true - selector: - boolean: null - prefer_rgb_color: - description: Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 - example: false - selector: - boolean: null - turn_on_lights: - description: Whether to turn on lights that are currently off. 🔆 - example: false - selector: - boolean: null -set_manual_control: - description: Mark whether a light is 'manually controlled'. - fields: - entity_id: - description: The `entity_id` of the switch in which to (un)mark the light as being `manually controlled`. 📝 - selector: - entity: - integration: adaptive_lighting - domain: switch - multiple: false - lights: - description: entity_id(s) of lights, if not specified, all lights in the switch are selected. 💡 - selector: - entity: - domain: light - multiple: true - manual_control: - description: Whether to add ("true") or remove ("false") the light from the "manual_control" list. 🔒 - example: true - default: true - selector: - boolean: null -change_switch_settings: - description: Change any settings you'd like in the switch. All options here are the same as in the config flow. - fields: - entity_id: - description: Entity ID of the switch. 📝 - required: true - selector: - entity: - domain: switch - use_defaults: - description: 'Sets the default values not specified in this service call. Options: "current" (default, retains current values), "factory" (resets to documented defaults), or "configuration" (reverts to switch config defaults). ⚙️' - example: current - required: false - default: current - selector: - select: - options: - - current - - configuration - - factory - include_config_in_attributes: - description: Show all options as attributes on the switch in Home Assistant when set to `true`. 📝 - required: false - selector: - boolean: null - turn_on_lights: - description: Whether to turn on lights that are currently off. 🔆 - example: false - required: false - selector: - boolean: null - initial_transition: - description: Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️ - example: 1 - required: false - selector: - text: null - sleep_transition: - description: Duration of transition when "sleep mode" is toggled in seconds. 😴 - example: 1 - required: false - selector: - text: null - max_brightness: - description: Maximum brightness percentage. 💡 - required: false - example: 100 - selector: - text: null - max_color_temp: - description: Coldest color temperature in Kelvin. ❄️ - required: false - example: 5500 - selector: - text: null - min_brightness: - description: Minimum brightness percentage. 💡 - required: false - example: 1 - selector: - text: null - min_color_temp: - description: Warmest color temperature in Kelvin. 🔥 - required: false - example: 2000 - selector: - text: null - only_once: - description: Adapt lights only when they are turned on (`true`) or keep adapting them (`false`). 🔄 - example: false - required: false - selector: - boolean: null - prefer_rgb_color: - description: Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 - required: false - example: false - selector: - boolean: null - separate_turn_on_commands: - description: Use separate `light.turn_on` calls for color and brightness, needed for some light types. 🔀 - required: false - example: false - selector: - boolean: null - send_split_delay: - description: Delay (ms) between `separate_turn_on_commands` for lights that don't support simultaneous brightness and color setting. ⏲️ - required: false - example: 0 - selector: - boolean: null - sleep_brightness: - description: Brightness percentage of lights in sleep mode. 😴 - required: false - example: 1 - selector: - text: null - sleep_rgb_or_color_temp: - description: Use either `"rgb_color"` or `"color_temp"` in sleep mode. 🌙 - required: false - example: color_temp - selector: - select: - options: - - rgb_color - - color_temp - sleep_rgb_color: - description: RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is "rgb_color"). 🌈 - required: false - selector: - color_rgb: null - sleep_color_temp: - description: Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴 - required: false - example: 1000 - selector: - text: null - sunrise_offset: - description: Adjust sunrise time with a positive or negative offset in seconds. ⏰ - required: false - example: 0 - selector: - number: - min: 0 - max: 86300 - sunrise_time: - description: Set a fixed time (HH:MM:SS) for sunrise. 🌅 - required: false - example: '' - selector: - time: null - sunset_offset: - description: Adjust sunset time with a positive or negative offset in seconds. ⏰ - required: false - example: '' - selector: - number: - min: 0 - max: 86300 - sunset_time: - description: Set a fixed time (HH:MM:SS) for sunset. 🌇 - example: '' - required: false - selector: - time: null - max_sunrise_time: - description: Set the latest virtual sunrise time (HH:MM:SS), allowing for earlier real sunrises. 🌅 - example: '' - required: false - selector: - time: null - min_sunset_time: - description: Set the earliest virtual sunset time (HH:MM:SS), allowing for later real sunsets. 🌇 - example: '' - required: false - selector: - time: null - take_over_control: - description: Disable Adaptive Lighting if another source calls `light.turn_on` while lights are on and being adapted. Note that this calls `homeassistant.update_entity` every `interval`! 🔒 - required: false - example: true - selector: - boolean: null - detect_non_ha_changes: - description: Detect non-`light.turn_on` state changes and stop adapting lights. Requires `take_over_control`. 🕵️ - required: false - example: false - selector: - boolean: null - transition: - description: Duration of transition when lights change, in seconds. 🕑 - required: false - example: 45 - selector: - text: null - adapt_delay: - description: Wait time (seconds) between light turn on and Adaptive Lighting applying changes. Might help to avoid flickering. ⏲️ - required: false - example: 0 - selector: - text: null - autoreset_control_seconds: - description: Automatically reset the manual control after a number of seconds. Set to 0 to disable. ⏲️ - required: false - example: 0 - selector: - text: null From 0674d6790755d3e829f6113dec721d25f2a3bb45 Mon Sep 17 00:00:00 2001 From: Benjamin Auquite Date: Wed, 12 Apr 2023 00:56:01 -0500 Subject: [PATCH 5/5] Revert "Delete services.yaml" This reverts commit 4f5305e16a5fde6f766a5d9c1979f8732ff684c6. --- .../adaptive_lighting/services.yaml | 251 ++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100755 custom_components/adaptive_lighting/services.yaml diff --git a/custom_components/adaptive_lighting/services.yaml b/custom_components/adaptive_lighting/services.yaml new file mode 100755 index 00000000..cd25811b --- /dev/null +++ b/custom_components/adaptive_lighting/services.yaml @@ -0,0 +1,251 @@ +# This file is auto-generated by .github/update-services.py. +apply: + description: Applies the current Adaptive Lighting settings to lights. + fields: + entity_id: + description: The `entity_id` of the switch with the settings to apply. 📝 + selector: + entity: + integration: adaptive_lighting + domain: switch + multiple: false + lights: + description: A light (or list of lights) to apply the settings to. 💡 + selector: + entity: + domain: light + multiple: true + transition: + description: Duration of transition when lights change, in seconds. 🕑 + example: 10 + selector: + text: null + adapt_brightness: + description: Whether to adapt the brightness of the light. 🌞 + example: true + selector: + boolean: null + adapt_color: + description: Whether to adapt the color on supporting lights. 🌈 + example: true + selector: + boolean: null + prefer_rgb_color: + description: Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 + example: false + selector: + boolean: null + turn_on_lights: + description: Whether to turn on lights that are currently off. 🔆 + example: false + selector: + boolean: null +set_manual_control: + description: Mark whether a light is 'manually controlled'. + fields: + entity_id: + description: The `entity_id` of the switch in which to (un)mark the light as being `manually controlled`. 📝 + selector: + entity: + integration: adaptive_lighting + domain: switch + multiple: false + lights: + description: entity_id(s) of lights, if not specified, all lights in the switch are selected. 💡 + selector: + entity: + domain: light + multiple: true + manual_control: + description: Whether to add ("true") or remove ("false") the light from the "manual_control" list. 🔒 + example: true + default: true + selector: + boolean: null +change_switch_settings: + description: Change any settings you'd like in the switch. All options here are the same as in the config flow. + fields: + entity_id: + description: Entity ID of the switch. 📝 + required: true + selector: + entity: + domain: switch + use_defaults: + description: 'Sets the default values not specified in this service call. Options: "current" (default, retains current values), "factory" (resets to documented defaults), or "configuration" (reverts to switch config defaults). ⚙️' + example: current + required: false + default: current + selector: + select: + options: + - current + - configuration + - factory + include_config_in_attributes: + description: Show all options as attributes on the switch in Home Assistant when set to `true`. 📝 + required: false + selector: + boolean: null + turn_on_lights: + description: Whether to turn on lights that are currently off. 🔆 + example: false + required: false + selector: + boolean: null + initial_transition: + description: Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️ + example: 1 + required: false + selector: + text: null + sleep_transition: + description: Duration of transition when "sleep mode" is toggled in seconds. 😴 + example: 1 + required: false + selector: + text: null + max_brightness: + description: Maximum brightness percentage. 💡 + required: false + example: 100 + selector: + text: null + max_color_temp: + description: Coldest color temperature in Kelvin. ❄️ + required: false + example: 5500 + selector: + text: null + min_brightness: + description: Minimum brightness percentage. 💡 + required: false + example: 1 + selector: + text: null + min_color_temp: + description: Warmest color temperature in Kelvin. 🔥 + required: false + example: 2000 + selector: + text: null + only_once: + description: Adapt lights only when they are turned on (`true`) or keep adapting them (`false`). 🔄 + example: false + required: false + selector: + boolean: null + prefer_rgb_color: + description: Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 + required: false + example: false + selector: + boolean: null + separate_turn_on_commands: + description: Use separate `light.turn_on` calls for color and brightness, needed for some light types. 🔀 + required: false + example: false + selector: + boolean: null + send_split_delay: + description: Delay (ms) between `separate_turn_on_commands` for lights that don't support simultaneous brightness and color setting. ⏲️ + required: false + example: 0 + selector: + boolean: null + sleep_brightness: + description: Brightness percentage of lights in sleep mode. 😴 + required: false + example: 1 + selector: + text: null + sleep_rgb_or_color_temp: + description: Use either `"rgb_color"` or `"color_temp"` in sleep mode. 🌙 + required: false + example: color_temp + selector: + select: + options: + - rgb_color + - color_temp + sleep_rgb_color: + description: RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is "rgb_color"). 🌈 + required: false + selector: + color_rgb: null + sleep_color_temp: + description: Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴 + required: false + example: 1000 + selector: + text: null + sunrise_offset: + description: Adjust sunrise time with a positive or negative offset in seconds. ⏰ + required: false + example: 0 + selector: + number: + min: 0 + max: 86300 + sunrise_time: + description: Set a fixed time (HH:MM:SS) for sunrise. 🌅 + required: false + example: '' + selector: + time: null + sunset_offset: + description: Adjust sunset time with a positive or negative offset in seconds. ⏰ + required: false + example: '' + selector: + number: + min: 0 + max: 86300 + sunset_time: + description: Set a fixed time (HH:MM:SS) for sunset. 🌇 + example: '' + required: false + selector: + time: null + max_sunrise_time: + description: Set the latest virtual sunrise time (HH:MM:SS), allowing for earlier real sunrises. 🌅 + example: '' + required: false + selector: + time: null + min_sunset_time: + description: Set the earliest virtual sunset time (HH:MM:SS), allowing for later real sunsets. 🌇 + example: '' + required: false + selector: + time: null + take_over_control: + description: Disable Adaptive Lighting if another source calls `light.turn_on` while lights are on and being adapted. Note that this calls `homeassistant.update_entity` every `interval`! 🔒 + required: false + example: true + selector: + boolean: null + detect_non_ha_changes: + description: Detect non-`light.turn_on` state changes and stop adapting lights. Requires `take_over_control`. 🕵️ + required: false + example: false + selector: + boolean: null + transition: + description: Duration of transition when lights change, in seconds. 🕑 + required: false + example: 45 + selector: + text: null + adapt_delay: + description: Wait time (seconds) between light turn on and Adaptive Lighting applying changes. Might help to avoid flickering. ⏲️ + required: false + example: 0 + selector: + text: null + autoreset_control_seconds: + description: Automatically reset the manual control after a number of seconds. Set to 0 to disable. ⏲️ + required: false + example: 0 + selector: + text: null