mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
* fix: clamp() collapsed to minimum when min_brightness > max_brightness A user can intentionally set min_brightness > max_brightness (or the equivalent for color temperature) for an inverted timescale -- e.g. a porch light that should be brighter at night than during the day. clamp()'s max(minimum, min(value, maximum)) assumed minimum <= maximum; when inverted, min(value, maximum) is always <= maximum < minimum, so max(minimum, ...) always returns minimum. linear and tanh brightness modes -- both of which end in a clamp(brightness, min_brightness, max_brightness) call -- got stuck returning one fixed value regardless of the time of day. Fixes #1421 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * test: accept current Home Assistant brightness validation errors Keep asserting the maximum brightness limit without depending on the validation library's dictionary-path wording. --------- Co-authored-by: Oscar Pacheco <proscar@MacBook-Pro-de-Oscar.local> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bas Nijholt <bas@nijho.lt> Co-authored-by: Bas Nijholt <basnijholt@gmail.com> |
||
|---|---|---|
| .. | ||
| translations | ||
| __init__.py | ||
| _docs_helpers.py | ||
| adaptation_utils.py | ||
| color_and_brightness.py | ||
| config_flow.py | ||
| const.py | ||
| docs_gen.py | ||
| hass_utils.py | ||
| helpers.py | ||
| manifest.json | ||
| services.yaml | ||
| strings.json | ||
| switch.py | ||