diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index ed5de50c4ce40ede99250dfae143bbf5f9fe21eb..b03f0023efc92b6ef5588c692bb1481acf07da89 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -49,7 +49,15 @@ jobs: - python-version: "3.12" core-version: "2024.3.3" - python-version: "3.12" - core-version: "2024.4.1" + core-version: "2024.4.4" + - python-version: "3.12" + core-version: "2024.5.5" + - python-version: "3.12" + core-version: "2024.6.4" + - python-version: "3.12" + core-version: "2024.7.4" + - python-version: "3.12" + core-version: "2024.8.3" - python-version: "3.12" core-version: "dev" steps: diff --git a/README.md b/README.md index 4b4031ec1074e03202d7a399ef0d98078139f2c9..94393aab03d2aea3bc1fee6dac07f98c20f57cd1 100644 --- a/README.md +++ b/README.md @@ -103,46 +103,46 @@ The YAML and frontend configuration methods support all of the options listed be <!-- START_OUTPUT --> <!-- THIS CONTENT IS AUTOMATICALLY GENERATED --> -| Variable name | Description | Default | Type | -|:-------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------|:---------------------------------------| -| `lights` | List of light entity_ids to be controlled (may be empty). π | `[]` | list of `entity_id`s | -| `interval` | Frequency to adapt the lights, in seconds. π | `90` | `int > 0` | -| `transition` | Duration of transition when lights change, in seconds. π | `45` | `float` 0-6553 | -| `initial_transition` | Duration of the first transition when lights turn from `off` to `on` in seconds. β²οΈ | `1` | `float` 0-6553 | -| `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 | -| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. π | `False` | `bool` | -| `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 | -| `sleep_transition` | Duration of transition when "sleep mode" is toggled in seconds. π΄ | `1` | `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` | -| `sunrise_time` | Set a fixed time (HH:MM:SS) for sunrise. π | `None` | `str` | -| `min_sunrise_time` | Set the earliest virtual sunrise time (HH:MM:SS), allowing for later sunrises. π | `None` | `str` | -| `max_sunrise_time` | Set the latest virtual sunrise time (HH:MM:SS), allowing for earlier 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 sunsets. π | `None` | `str` | -| `max_sunset_time` | Set the latest virtual sunset time (HH:MM:SS), allowing for earlier sunsets. π | `None` | `str` | -| `sunset_offset` | Adjust sunset time with a positive or negative offset in seconds. β° | `0` | `int` | -| `brightness_mode` | Brightness mode to use. Possible values are `default`, `linear`, and `tanh` (uses `brightness_mode_time_dark` and `brightness_mode_time_light`). π | `default` | one of `['default', 'linear', 'tanh']` | +| Variable name | Description | Default | Type | +|:-------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------|:---------------------------------------| +| `lights` | List of light entity_ids to be controlled (may be empty). π | `[]` | list of `entity_id`s | +| `interval` | Frequency to adapt the lights, in seconds. π | `90` | `int > 0` | +| `transition` | Duration of transition when lights change, in seconds. π | `45` | `float` 0-6553 | +| `initial_transition` | Duration of the first transition when lights turn from `off` to `on` in seconds. β²οΈ | `1` | `float` 0-6553 | +| `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 | +| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. π | `False` | `bool` | +| `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 | +| `sleep_transition` | Duration of transition when "sleep mode" is toggled in seconds. π΄ | `1` | `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` | +| `sunrise_time` | Set a fixed time (HH:MM:SS) for sunrise. π | `None` | `str` | +| `min_sunrise_time` | Set the earliest virtual sunrise time (HH:MM:SS), allowing for later sunrises. π | `None` | `str` | +| `max_sunrise_time` | Set the latest virtual sunrise time (HH:MM:SS), allowing for earlier 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 sunsets. π | `None` | `str` | +| `max_sunset_time` | Set the latest virtual sunset time (HH:MM:SS), allowing for earlier sunsets. π | `None` | `str` | +| `sunset_offset` | Adjust sunset time with a positive or negative offset in seconds. β° | `0` | `int` | +| `brightness_mode` | Brightness mode to use. Possible values are `default`, `linear`, and `tanh` (uses `brightness_mode_time_dark` and `brightness_mode_time_light`). π | `default` | one of `['default', 'linear', 'tanh']` | | `brightness_mode_time_dark` | (Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness before/after sunrise/sunset. ππ | `900` | `int` | | `brightness_mode_time_light` | (Ignored if `brightness_mode='default'`) The duration in seconds to ramp up/down the brightness after/before sunrise/sunset. ππ. | `3600` | `int` | -| `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` | Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. π΅οΈ Caution: β οΈ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Disable this feature if you encounter such issues. | `False` | `bool` | -| `autoreset_control_seconds` | Automatically reset the manual control after a number of seconds. Set to 0 to disable. β²οΈ | `0` | `int` 0-31536000 | -| `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` | Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. π΅οΈ Caution: β οΈ Some lights might falsely indicate an 'on' state, which could result in lights turning on unexpectedly. Disable this feature if you encounter such issues. | `False` | `bool` | +| `autoreset_control_seconds` | Automatically reset the manual control after a number of seconds. Set to 0 to disable. β²οΈ | `0` | `int` 0-31536000 | +| `only_once` | Adapt lights only when they are turned on (`true`) or keep adapting them (`false`). π | `False` | `bool` | | `adapt_only_on_bare_turn_on` | When turning lights on initially. If set to `true`, AL adapts only if `light.turn_on` is invoked without specifying color or brightness. βπ This e.g., prevents adaptation when activating a scene. If `false`, AL adapts regardless of the presence of color or brightness in the initial `service_data`. Needs `take_over_control` enabled. π΅οΈ | `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` | -| `skip_redundant_commands` | Skip sending adaptation commands whose target state already equals the light's known state. Minimizes network traffic and improves the adaptation responsivity in some situations. πDisable if physical light states get out of sync with HA's recorded state. | `False` | `bool` | -| `intercept` | Intercept and adapt `light.turn_on` calls to enabling instantaneous color and brightness adaptation. ποΈ Disable for lights that do not support `light.turn_on` with color and brightness. | `True` | `bool` | -| `multi_light_intercept` | Intercept and adapt `light.turn_on` calls that target multiple lights. ββ οΈ This might result in splitting up a single `light.turn_on` call into multiple calls, e.g., when lights are in different switches. Requires `intercept` to be enabled. | `True` | `bool` | -| `include_config_in_attributes` | Show all options as attributes on the switch in Home Assistant when set to `true`. π | `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` | +| `skip_redundant_commands` | Skip sending adaptation commands whose target state already equals the light's known state. Minimizes network traffic and improves the adaptation responsivity in some situations. πDisable if physical light states get out of sync with HA's recorded state. | `False` | `bool` | +| `intercept` | Intercept and adapt `light.turn_on` calls to enabling instantaneous color and brightness adaptation. ποΈ Disable for lights that do not support `light.turn_on` with color and brightness. | `True` | `bool` | +| `multi_light_intercept` | Intercept and adapt `light.turn_on` calls that target multiple lights. ββ οΈ This might result in splitting up a single `light.turn_on` call into multiple calls, e.g., when lights are in different switches. Requires `intercept` to be enabled. | `True` | `bool` | +| `include_config_in_attributes` | Show all options as attributes on the switch in Home Assistant when set to `true`. π | `False` | `bool` | <!-- END_OUTPUT --> @@ -186,15 +186,15 @@ adaptive_lighting: <!-- START_OUTPUT --> <!-- THIS CONTENT IS AUTOMATICALLY GENERATED --> -| Service data attribute | Description | Required | Type | -|:-------------------------|:-------------------------------------------------------------------------------------|:-----------|:---------------------| -| `entity_id` | The `entity_id` of the switch with the settings to apply. π | β | list of `entity_id`s | -| `lights` | A light (or list of lights) to apply the settings to. π‘ | β | list of `entity_id`s | -| `transition` | Duration of transition when lights change, in seconds. π | β | `float` 0-6553 | -| `adapt_brightness` | Whether to adapt the brightness of the light. π | β | bool | -| `adapt_color` | Whether to adapt the color on supporting lights. π | β | bool | -| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. π | β | bool | -| `turn_on_lights` | Whether to turn on lights that are currently off. π | β | bool | +| Service data attribute | Description | Required | Type | +|:-------------------------|:--------------------------------------------------------------------------------------|:-----------|:---------------------| +| `entity_id` | The `entity_id` of the switch with the settings to apply. π | β | list of `entity_id`s | +| `lights` | A light (or list of lights) to apply the settings to. π‘ | β | list of `entity_id`s | +| `transition` | Duration of transition when lights change, in seconds. π | β | `float` 0-6553 | +| `adapt_brightness` | Whether to adapt the brightness of the light. π | β | bool | +| `adapt_color` | Whether to adapt the color on supporting lights. π | β | bool | +| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. π | β | bool | +| `turn_on_lights` | Whether to turn on lights that are currently off. π | β | bool | <!-- END_OUTPUT --> #### `adaptive_lighting.set_manual_control` @@ -208,11 +208,11 @@ adaptive_lighting: <!-- START_OUTPUT --> <!-- THIS CONTENT IS AUTOMATICALLY GENERATED --> -| Service data attribute | Description | Required | Type | -|:-------------------------|:-----------------------------------------------------------------------------------------------|:-----------|:---------------------| -| `entity_id` | The `entity_id` of the switch in which to (un)mark the light as being `manually controlled`. π | β | list of `entity_id`s | -| `lights` | entity_id(s) of lights, if not specified, all lights in the switch are selected. π‘ | β | list of `entity_id`s | -| `manual_control` | Whether to add ("true") or remove ("false") the light from the "manual_control" list. π | β | bool | +| Service data attribute | Description | Required | Type | +|:-------------------------|:------------------------------------------------------------------------------------------------|:-----------|:---------------------| +| `entity_id` | The `entity_id` of the switch in which to (un)mark the light as being `manually controlled`. π | β | list of `entity_id`s | +| `lights` | entity_id(s) of lights, if not specified, all lights in the switch are selected. π‘ | β | list of `entity_id`s | +| `manual_control` | Whether to add ("true") or remove ("false") the light from the "manual_control" list. π | β | bool | <!-- END_OUTPUT --> #### `adaptive_lighting.change_switch_settings` diff --git a/scripts/setup-dependencies b/scripts/setup-dependencies index efe0bd25c1616f9b10449d48dd5173a60cd48f08..ca14045d21906608dc61fdecfdbbc9cb1499f5cd 100755 --- a/scripts/setup-dependencies +++ b/scripts/setup-dependencies @@ -9,6 +9,11 @@ if grep -q 'codecov' core/requirements_test.txt; then # however it is removed from PyPI, so we cannot install it sed -i '/codecov/d' core/requirements_test.txt fi + +if grep -q 'mypy-dev==1.10.0a3' core/requirements_test.txt; then + # mypy-dev==1.10.0a3 seems to not be available anymore, HA 2024.4 and 2024.5 are affected + sed -i 's/mypy-dev==1.10.0a3/mypy-dev==1.10.0b1/' core/requirements_test.txt +fi pip install -r core/requirements_test.txt pip install -e core/