Commit graph

1,053 commits

Author SHA1 Message Date
Bas Nijholt
e0f812d406
Bump to v1.30.1 (#1384) v1.30.1 2026-01-12 13:46:19 +01:00
Bas Nijholt
e61a018616
Fix regression: lights not adapting when turned on by automation (#1380)
## Summary

- Fixes regression in v1.30.0 where lights turned on by automations were incorrectly marked as "manually controlled"
- Makes `adapt_only_on_bare_turn_on` respect individual attribute tracking from #1356

## Root Cause

PR #1356 added a call to `update_manually_controlled_from_event()` in the `turn_on_off_event_listener.on()` handler for ALL `light.turn_on` events, including when turning a light on from OFF state.

When an automation turns on a light with brightness/color attributes, this incorrectly marked the light as "manually controlled", preventing Adaptive Lighting from adapting it.

## Fix

1. Only call `update_manually_controlled_from_event()` when the light was **already ON** before the turn_on event. Turning on from OFF is handled by `_respond_to_off_to_on_event()`.

2. Make `adapt_only_on_bare_turn_on` respect `take_over_control_mode`:
   - With `PAUSE_CHANGED`: Only pause adaptation of specified attributes, continue adapting unspecified ones
   - With `PAUSE_ALL`: Pause all adaptation (existing behavior)

## Expected Behavior After Fix

| Scenario | `adapt_only_on_bare_turn_on` | `take_over_control_mode` | Result |
|----------|------------------------------|--------------------------|--------|
| Turn on from OFF with brightness | `false` | Either | NOT manually controlled |
| Turn on from OFF with brightness | `true` | `PAUSE_ALL` | All adaptation paused |
| Turn on from OFF with brightness | `true` | `PAUSE_CHANGED` | Only brightness paused, color adapts |
| Turn on from OFF without attributes | Either | Either | NOT manually controlled |
| Change brightness while ON | Either | Either | Brightness manually controlled |

## Test plan

- [x] Turn on light via automation with brightness/color (`adapt_only_on_bare_turn_on=false`) - should adapt
- [x] Turn on light via scene (`adapt_only_on_bare_turn_on=true`, `PAUSE_ALL`) - should pause all adaptation
- [x] Turn on light with brightness only (`adapt_only_on_bare_turn_on=true`, `PAUSE_CHANGED`) - should adapt color
- [x] Both intercept=True and intercept=False paths tested for consistency
- [x] CI tests pass

Fixes #1378

Co-authored-by: Mario Guggenberger <mg@protyposis.net>
2026-01-12 13:40:55 +01:00
Bas Nijholt
49f9da14fe
docs: clarify Docker test setup requirements (#1383) 2026-01-11 21:57:52 +01:00
Bas Nijholt
f95093e1dc Bump to v1.30.0 v1.30.0 2026-01-05 12:43:07 -08:00
Mario Guggenberger
f84ee445b7
Individual manual control of brightness and color (#1356)
* refactor: introduce light control parameter enum

* refactor: replace manual control flag with parameter enum

* test: update deprecated color temp attribute

* build: set execution bits on task scripts

* feat: individual manual control of brightness and color

* test: add tests for individual manual control evaluation

* fix: sequential manual changes not always detected

If multiple attributes of a light were changed within an interval, only the last change was detected because the check in the interval only used the latest event. For example, if there was a brightness change and a following color change, only the color attribute was detected as manually controlled. To fix this, the manual control attribute flags are now set directly from the event handler so that all events are processed.

* fix: invalid service description

* docs: fix missing space in config description

* refactor: pluralize multivalued bitmask enum name
2025-12-22 22:55:16 -08:00
Weblate (bot)
2f599d6e1b
Translations update from Hosted Weblate (#1331)
* Translated using Weblate (German)

Currently translated at 100.0% (156 of 156 strings)

Co-authored-by: Anton <ihrkenntmichnicht@posteo.de>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/de/
Translation: Adaptive Lighting/Adaptive Lighting

* Translated using Weblate (Catalan)

Currently translated at 100.0% (156 of 156 strings)

Co-authored-by: Enric Pagès i Gassull <enricpages@hotmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/ca/
Translation: Adaptive Lighting/Adaptive Lighting

---------

Co-authored-by: Anton <ihrkenntmichnicht@posteo.de>
Co-authored-by: Enric Pagès i Gassull <enricpages@hotmail.com>
2025-12-12 14:00:30 -08:00
renovate[bot]
828f73d481
⬆️ Update actions/checkout action to v6 (#1352)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-12 13:59:40 -08:00
lenucksi
9c7a95f696
fix(ci): fix broken Docker workflow and modernize (#1318)
* fix(ci): fix broken Docker workflow and modernize

## Critical Bug Fixes

1. **Fix broken push condition** (CRITICAL):
   - Old: `push: ${{ github.ref == 'refs/heads/master' }}`
   - Problem: Branch renamed to `main`, so images NEVER pushed
   - New: `push: ${{ github.event_name != 'pull_request' }}`
   - Result: Docker images will actually be published again

2. **Add missing checkout step**:
   - Build was failing because source code wasn't checked out
   - Required for Docker build context

## Modernization Improvements

3. **Migrate to GitHub Container Registry (GHCR)**:
   - Old: DockerHub with `DOCKERHUB_USERNAME` and `DOCKERHUB_TOKEN` secrets
   - New: GHCR with built-in `GITHUB_TOKEN`
   - Benefits: No external account required, better integration

4. **Add semantic versioning**:
   - Automatically tags releases: `v1.2.3`, `v1.2`, `v1`, `latest`
   - Supports version tags (v*), branches, and PRs
   - Uses docker/metadata-action for automatic tagging

5. **Add GitHub Actions caching**:
   - Uses `type=gha` cache for faster builds
   - Reduces build times and GitHub Actions minutes

6. **Security: Digest pinning**:
   - All actions pinned to commit SHAs
   - Prevents supply chain attacks via tag manipulation
   - Follows security best practices

7. **Add explicit permissions**:
   - Minimal required permissions (contents: read, packages: write)
   - Follows principle of least privilege

8. **Add workflow triggers**:
   - Tags (v*) for releases
   - Pull requests for testing
   - Manual dispatch for on-demand builds

## Testing

- Workflow syntax validated
- Push logic tested with different event types
- Compatible with existing Docker build process

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(ci): simplify docker workflow

- Use version tags instead of SHA pins for readability
- Remove verbose step names (action names are self-documenting)
- Compact YAML formatting
- Fix actions/checkout to v4 (v6 doesn't exist)

---------

Co-authored-by: Bas Nijholt <bas@nijho.lt>
2025-12-12 13:49:45 -08:00
Mario Guggenberger
79973fb71d
chore(devcontainer): fix Pylance resolution of HA core modules (#1343) 2025-12-12 13:38:35 -08:00
Mario Guggenberger
5886eee04c
Code cleanup (#1348) 2025-12-12 13:37:42 -08:00
Bas Nijholt
ce7dadebdd
ci: workaround aiodns/pycares compatibility issue (#1351)
Upgrade aiodns after installing dependencies to fix compatibility
issue with pycares.

See: https://github.com/aio-libs/aiodns/issues/214
2025-12-12 13:29:46 -08:00
Bas Nijholt
94b91a0ddc
fix: use correct entity and context in service interceptor (#1349) 2025-12-12 13:05:01 -08:00
Bas Nijholt
dc61bd191c
Bump to v1.29.0 2025-12-09 23:58:19 -08:00
Bas Nijholt
0180fa4a93
feat: use EntitySelector for light entity selection with search support (#1335) v1.29.0
Replace cv.multi_select with HA's EntitySelector for the lights field
in the options flow. This provides:

- Built-in search/typing to find entities faster
- Better UX with HA's native entity picker
- Improved handling of renamed entities

Closes #1208
2025-12-09 23:51:17 -08:00
renovate[bot]
37ef65586d
⬆️ Update python to v3.14.2 (#1251)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-09 23:31:41 -08:00
renovate[bot]
97ecbb17a0
⬆️ Update actions/checkout action to v6.0.1 (#1328)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-09 23:31:17 -08:00
renovate[bot]
ef15d5cd48
⬆️ Update peter-evans/create-pull-request action to v8 (#1334)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-09 23:31:05 -08:00
allcontributors[bot]
ea623ce604
docs: add edgimar as a contributor for code (#1330)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2025-12-05 04:15:38 -08:00
edgimar
4aeb50bfe3
feat: add option to duplicate existing lighting instance (#1329)
* feat: add option to duplicate existing lighting instance

A menu step in the config flow was added that allows a user to create a
new instance or duplicate the options of an existing one.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add type annotation, tests, and translations for duplicate feature

- Add type annotation for source_options class attribute
- Add menu step translations to en.json
- Add tests for menu display, new instance creation, and duplication

* Simplify source_options access with class-level default

---------
Co-authored-by: Bas Nijholt <bas@nijho.lt>
2025-12-05 04:15:24 -08:00
renovate[bot]
886c77bcc2
⬆️ Update actions/setup-python action to v6 (#1327)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-30 22:54:08 -08:00
Weblate (bot)
2f03e00dc6
Translated using Weblate (Danish) (#1326)
Currently translated at 94.1% (144 of 153 strings)


Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/da/
Translation: Adaptive Lighting/Adaptive Lighting

Co-authored-by: Hans Henrik Juhl <hans@kopula.dk>
2025-11-30 22:53:52 -08:00
lenucksi
077e086424
fix(ci): correct branch name and path in update-readme workflow (#1321) 2025-11-30 08:22:57 -08:00
allcontributors[bot]
f04c91b54b
docs: add lenucksi as a contributor for code (#1325) 2025-11-30 08:18:36 -08:00
renovate[bot]
1be701994b
⬆️ Pin python to 3.12.12 (#1323) 2025-11-30 08:16:24 -08:00
renovate[bot]
fb6e96c878
⬆️ Update actions/checkout action to v6 (#1324) 2025-11-30 08:16:05 -08:00
lenucksi
7a5ad22c62
fix(devcontainer): install uv and add venv cleanup (#1317) 2025-11-30 08:14:27 -08:00
Lenucksi
cc25a50401 ci: add automated weekly test matrix updates
Add automation to keep the pytest test matrix up-to-date with latest
Home Assistant Core releases:

1. **Weekly Automation**: New workflow updates test matrix automatically
2. **Version Fetcher**: Python script queries GitHub API for latest HA Core releases
3. **PR Creation**: Automatically creates PRs when new versions are available

## Benefits
- No more manual updates when new HA Core versions are released
- Automatic tracking of new HA Core releases
- Reduces maintenance burden

## Background
This builds on commit a982acb which fixed mypy-dev pinning. While upstream
now installs latest mypy-dev automatically, the test matrix versions still
need manual updates. This automation solves that remaining manual task.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 08:09:19 -08:00
lenucksi
894d0025cd
fix(ci): add branch filter to TOC generator workflow (#1320) 2025-11-30 08:06:21 -08:00
Bas Nijholt
80fb93b9f6
Fix propcache dependency (revert to functools) (#1314) 2025-11-28 16:43:52 -08:00
Bas Nijholt
1968e1a9a6
Bump to v1.28.0 (#1310) v1.28.0 2025-11-27 12:42:20 -08:00
allcontributors[bot]
2391d99539 docs: update .all-contributorsrc 2025-11-27 12:03:04 -08:00
allcontributors[bot]
bba7bb8350 docs: update README.md 2025-11-27 12:03:04 -08:00
Dobby
19d30430bb
Friendly names (#1258) 2025-11-27 12:01:05 -08:00
Bas Nijholt
a982acb384
Stop pinning mypy-dev versions since old releases get deleted from PyPI (#1308) 2025-11-27 12:00:47 -08:00
Bas Nijholt
d95f0d4bc6
Fix xfail and skipped tests to properly pass (#1307) 2025-11-27 18:52:11 +00:00
Weblate (bot)
8ff3babae2
Translations update from Hosted Weblate (#1228)
* Translated using Weblate (Galician)

Currently translated at 50.3% (77 of 153 strings)

Translated using Weblate (Galician)

Currently translated at 49.0% (75 of 153 strings)

Translated using Weblate (Galician)

Currently translated at 46.4% (71 of 153 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Yago Raña Gayoso <yago.rana.gayoso@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/gl/
Translation: Adaptive Lighting/Adaptive Lighting

* Translated using Weblate (Turkish)

Currently translated at 100.0% (153 of 153 strings)

Added translation using Weblate (Turkish)

Co-authored-by: Furkan Kaya <fkaya.personal@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/tr/
Translation: Adaptive Lighting/Adaptive Lighting

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 56.8% (87 of 153 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Rafael do Amaral Porciuncula <rafael.do.amaralp@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/pt_BR/
Translation: Adaptive Lighting/Adaptive Lighting

* Translated using Weblate (Danish)

Currently translated at 90.1% (138 of 153 strings)

Translated using Weblate (Danish)

Currently translated at 88.8% (136 of 153 strings)

Translated using Weblate (Danish)

Currently translated at 88.8% (136 of 153 strings)

Translated using Weblate (Danish)

Currently translated at 88.8% (136 of 153 strings)

Co-authored-by: Emil Friis Osmann <Emilfriisosmann@gmail.com>
Co-authored-by: Hans Henrik Juhl <hans@kopula.dk>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/da/
Translation: Adaptive Lighting/Adaptive Lighting

* Translated using Weblate (Russian)

Currently translated at 99.3% (152 of 153 strings)

Co-authored-by: Athish Athish <athisha660@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/ru/
Translation: Adaptive Lighting/Adaptive Lighting

* Translated using Weblate (Ukrainian)

Currently translated at 100.0% (153 of 153 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Максим Горпиніч <gorpinicmaksim0@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/uk/
Translation: Adaptive Lighting/Adaptive Lighting

* Translated using Weblate (Japanese)

Currently translated at 48.3% (74 of 153 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: M.Sugahara <equaaqua@hotmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/ja/
Translation: Adaptive Lighting/Adaptive Lighting

* Translated using Weblate (Hungarian)

Currently translated at 100.0% (153 of 153 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: therealmate <hellogaming91@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/hu/
Translation: Adaptive Lighting/Adaptive Lighting

* Translated using Weblate (Slovenian)

Currently translated at 71.2% (109 of 153 strings)

Added translation using Weblate (Slovenian)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Tim Music <tim.music98@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/sl/
Translation: Adaptive Lighting/Adaptive Lighting

---------

Co-authored-by: Yago Raña Gayoso <yago.rana.gayoso@gmail.com>
Co-authored-by: Furkan Kaya <fkaya.personal@gmail.com>
Co-authored-by: Rafael do Amaral Porciuncula <rafael.do.amaralp@gmail.com>
Co-authored-by: Emil Friis Osmann <Emilfriisosmann@gmail.com>
Co-authored-by: Hans Henrik Juhl <hans@kopula.dk>
Co-authored-by: Athish Athish <athisha660@gmail.com>
Co-authored-by: Максим Горпиніч <gorpinicmaksim0@gmail.com>
Co-authored-by: M.Sugahara <equaaqua@hotmail.com>
Co-authored-by: therealmate <hellogaming91@gmail.com>
Co-authored-by: Tim Music <tim.music98@gmail.com>
2025-11-27 10:15:06 -08:00
allcontributors[bot]
d7aa3439d5
docs: add therealmate as a contributor for translation (#1306) 2025-11-27 10:14:16 -08:00
allcontributors[bot]
d12394dc03
docs: add plageoj as a contributor for translation (#1305) 2025-11-27 10:13:53 -08:00
allcontributors[bot]
0ddb79b03f
docs: add maksim2005UKR as a contributor for translation (#1304) 2025-11-27 10:13:26 -08:00
allcontributors[bot]
ce16be20b5
docs: add Athishbalu as a contributor for translation (#1303) 2025-11-27 10:13:01 -08:00
allcontributors[bot]
c37e992be9
docs: add hhjuhl as a contributor for translation (#1302) 2025-11-27 10:12:38 -08:00
allcontributors[bot]
5274a3fefa
docs: add Rafael4A as a contributor for translation (#1301) 2025-11-27 10:11:53 -08:00
allcontributors[bot]
edefdbf3b8
docs: add Wijt as a contributor for translation (#1300)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2025-11-27 10:11:31 -08:00
Bas Nijholt
4feaf2c291
Add bidirectional color mode change detection (issue #1275) (#1299)
Extract _has_color_mode_changed() function that checks original attributes
BEFORE conversion, enabling detection of all mode switches:
- color_temp → RGB ✓
- color_temp → XY ✓
- RGB → color_temp ✓
- RGB → XY ✓
- XY → color_temp ✓
- XY → RGB ✓

This improves on PR #1282 by detecting mode changes in both directions.
2025-11-27 10:02:50 -08:00
allcontributors[bot]
41e13bc944
docs: add DataGhost as a contributor for code (#1298)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2025-11-27 09:57:41 -08:00
DataGhost
afd7b935d7
Check for external light mode (temperature vs rgb) switch (#1282) 2025-11-27 09:54:14 -08:00
allcontributors[bot]
3d3d246918
docs: add ams2990 as a contributor for code (#1297)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2025-11-27 09:36:04 -08:00
ams2990
32719eabae
Fix some type hint issues (#1280) 2025-11-27 09:35:09 -08:00
renovate[bot]
561749ac06
⬆️ Update actions/setup-python action to v6 (#1261)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-27 09:34:46 -08:00
renovate[bot]
f6321afeae
⬆️ Update actions/upload-pages-artifact action to v4 (#1259)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-27 09:30:26 -08:00