`ln -fs` dereferences an existing symlink to a directory and creates the
new link *inside* it, so running the script a second time left two stray
symlinks in the working tree instead of replacing the existing ones:
tests/tests -> ../../../tests/
custom_components/adaptive_lighting/adaptive_lighting
-> ../../../custom_components/adaptive_lighting
Neither path is gitignored, so `git add -A` commits them.
Add `-n` so an existing symlink is treated as a file and replaced.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix: replace deprecated get_astral_location with get_astral_observer (#1481)
HA 2026.7 deprecates homeassistant.helpers.sun.get_astral_location
(removal planned for 2027.7) in favor of get_astral_observer, causing a
deprecation warning in the HA logs.
- Switch SunEvents/SunLightSettings from astral.location.Location to
astral.Observer, using the astral.sun module functions (which return
UTC times by default, matching the previous local=False calls).
- Use get_astral_observer in switch.py, with a fallback for HA < 2026.7
that constructs the Observer directly from the HA config.
- Update tests and the webapp simulator accordingly.
* ci: handle removal of requirements_test_all.txt in HA 2026.8 dev
HA core removed requirements_test_all.txt (home-assistant/core#171530),
which made test_dependencies.py crash with FileNotFoundError and broke
the dev pytest job and the Docker builds. Fall back to
requirements_all.txt, which carries the same per-integration
'# homeassistant.components.x' annotations. Also extend the
aiohasupervisor pin lookup in scripts/setup-dependencies accordingly.
* test: support modern template light config for HA 2026.6+
HA 2026.6 removed the legacy `light: platform: template` YAML format
(home-assistant/core#169615), so setup_lights found no template platform
on HA dev and every test using it failed with IndexError. Detect legacy
support at runtime (PLATFORM_SCHEMA presence) and fall back to the
modern `template:` config format. The group platform is set up before
the template integration in the modern path, because setting up
`template` also sets up the `light` domain, which would make a later
async_setup_component(hass, LIGHT_DOMAIN, ...) a no-op.
Two issues prevented the script from running on macOS without manual intervention:
1. `sed -i` requires a backup suffix on macOS BSD sed. Replace with a
portable `grep -v | mv` idiom that works on both macOS and Linux.
2. `python` is not in PATH on macOS by default. Replace with `python3`.
Co-authored-by: Florian Horner <florianhorner@macbook-pro-von-florian.tail6f28f8.ts.net>
Co-authored-by: Bas Nijholt <basnijholt@users.noreply.github.com>
## Summary
- fix hassfest validation by replacing raw options-description URLs with Home Assistant translation placeholders
- extend the pytest CI matrix to cover the latest patch release for each Home Assistant month, plus dev
- align CI/dev container Python versions and tests with newer Home Assistant behavior
## Validation
- GitHub Actions pytest matrix passed for 2024.12.5 through 2026.4.3 plus dev
- Docker passed for linux/amd64 and linux/arm64
- hassfest, HACS validation, pre-commit, pre-commit.ci, markdown-code-runner, docs build, and Release Drafter passed
This fixes the workflow to work for pull requests in addition to pushes:
- Correctly determines the repository and branch
- For pull requests, if there are changes, fails with a message to make
the changes locally
- Extracts the commands to update generated files into a script
* 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
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>
* Update .devcontainer
* Drop support for ≤2023.6
* Add .vscode/settings.json
* Use async_process_ha_core_config
* Fix for HA ≤2023.10
* pop normalized_name
* Add comments
* use . instead of source
* set pytest args
* set country
* use py3.13 for dev branch of core
* set country in test_adaptive_lighting_time_zones_with_default_settings
* Add comment
* build: dev container
Add a VS Code Dev Container from the blueprint at bceaae212f
* build: dev container test setup
Add support for unit testing in the dev container environment with debugging and code coverage.
* ci: adjust to dev container test restructuring
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* ci: fix coverage collection
* build: add dummy light to HA config
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* build: update dev container to Python 3.11 (for HA 2023.6)
* Add VS Code tasks
* Use pre-commit hooks for linting
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Unpin HA version
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bas Nijholt <basnijholt@gmail.com>