Add config flow to Avea#168070
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Migrates the Avea integration to a config-entry-based setup with Bluetooth discovery, replacing legacy YAML/platform setup and adding tests for the new flow and entity behavior.
Changes:
- Added config flow with Bluetooth discovery (and translations/manifest updates).
- Refactored light platform to async config entry setup using runtime data and HA’s Bluetooth device.
- Added test coverage for config flow and light behaviors.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/avea/__init__.py |
Adds config-entry setup/unload + runtime_data wiring for the Bulb instance |
homeassistant/components/avea/config_flow.py |
Implements user + Bluetooth discovery config flow and validation |
homeassistant/components/avea/const.py |
Introduces integration constants used by config flow/device info |
homeassistant/components/avea/light.py |
Moves light setup to async_setup_entry and uses runtime_data + BT device refresh |
homeassistant/components/avea/manifest.json |
Enables config flow + Bluetooth discovery metadata |
homeassistant/components/avea/strings.json |
Adds config flow strings/keys |
tests/components/avea/__init__.py |
Adds shared Bluetooth discovery fixtures/data for tests |
tests/components/avea/conftest.py |
Adds autouse Bluetooth fixtures for test isolation |
tests/components/avea/test_config_flow.py |
Adds config flow tests (user + Bluetooth discovery paths) |
tests/components/avea/test_light.py |
Adds light entity behavior tests using config entry setup |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2aff09e5f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Erwin Douna <e.douna@gmail.com>
Co-authored-by: Erwin Douna <e.douna@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 16 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
homeassistant/components/avea/light.py:168
- Set a stable
unique_id(and correspondingdevice_infofor the Bluetooth device) forAveaLightso the entity is registered in the entity/device registry and can be managed reliably from the UI.
def __init__(self, light: avea.Bulb) -> None:
"""Initialize an AveaLight."""
self._light = light
self._attr_name = light.name
self._attr_brightness = light.brightness
# Conflicts: # homeassistant/components/avea/light.py
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 16 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
homeassistant/components/avea/light.py:167
- Initialize
_attr_brightnessusing Home Assistant’s 0-255 scale instead of the bulb’s likely 0-4095 raw value. Setting_attr_brightness = light.brightnesscan publish an out-of-range brightness if the firstupdate_before_addread fails (or before the first successful update), so compute/normalize it (or leave it unset untilupdate()populates it).
def __init__(self, light: avea.Bulb) -> None:
"""Initialize an AveaLight."""
self._light = light
self._attr_name = light.name
self._attr_brightness = light.brightness
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0fec0fd73
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 16 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
homeassistant/components/avea/light.py:176
- Avoid using the library default/placeholder bulb name (e.g., "Unknown") as the entity name. The config flow/YAML import already normalizes "Unknown" to a better fallback (discovery name/address), but the entity currently sets _attr_name = light.name, which can reintroduce "Unknown" names and confusing entity_ids. Consider using the config entry title (validated/normalized) or applying the same _normalize_name fallback here.
def __init__(self, light: avea.Bulb) -> None:
"""Initialize an AveaLight."""
self._light = light
self._attr_name = light.name
self._attr_brightness = light.brightness
Co-authored-by: Erwin Douna <e.douna@gmail.com> Co-authored-by: Joostlek <joostlek@outlook.com>
…-timer * upstream/dev: Bump infrared-protocols to 5.1.0 (home-assistant#170365) Clean up template engine after extension modularization (home-assistant#170346) Bump axis to v71 (home-assistant#170347) Enhance WebDAV metadata download with concurrency (home-assistant#170223) Add target temperature sensor for ViCare RadiatorActuator devices (home-assistant#170102) Bump pyzbar to 0.1.9 (home-assistant#170076) homematicip_cloud: fix HmIP-FLC lock state polarity (home-assistant#170159) Watts: add timer mode service (home-assistant#169846) Set parallel updates for Ecowitt platforms (home-assistant#170349) Add config flow to Avea (home-assistant#168070) Cleanup Eurotronic number platform (home-assistant#170337) Add number platform to eurotronic_cometblue (home-assistant#168119)
Proposed change
This PR migrates the
aveaintegration from legacy YAML platform setup to a config-entry-based integration with Bluetooth discovery.It adds a config flow, supports Bluetooth auto-discovery, and moves setup to
async_setup_entry. The legacy YAML platform now imports discovered bulbs into config entries, so existing setups migrate automatically when the bulbs are reachable during import. If a bulb is not reachable during import, it may still need to be added manually through the UI.The PR also adds tests for the config flow, YAML import, and light platform behavior, and updates the integration metadata and translation strings required for config flows.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: