Remove name from Airly config flow#169145
Draft
bieniu wants to merge 2 commits intohome-assistant:devfrom
Draft
Conversation
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Airly integration to remove the user-provided name field from the config flow, aligning with the hass-config-flow-name-field rule.
Changes:
- Removes
CONF_NAMEfrom the Airly config flow schema and from test fixtures. - Introduces
DEFAULT_NAMEand updates sensors to fall back when legacynameis absent. - Updates tests and snapshots to reflect new default entity IDs/names and config entry title expectations.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| homeassistant/components/airly/config_flow.py | Removes the name field and updates entry title generation. |
| homeassistant/components/airly/sensor.py | Falls back to a default name when CONF_NAME is not present in entry data. |
| homeassistant/components/airly/const.py | Adds DEFAULT_NAME constant. |
| tests/components/airly/test_config_flow.py | Adjusts config flow tests for removed name field and new title. |
| tests/components/airly/test_init.py | Removes name from mocked config entries and updates expected entity IDs. |
| tests/components/airly/test_sensor.py | Updates entity IDs used in availability/manual update tests. |
| tests/components/airly/init.py | Removes name from the test config entry fixture. |
| tests/components/airly/snapshots/test_sensor.ambr | Updates snapshot entity IDs and friendly names to match new defaults. |
| tests/components/airly/snapshots/test_diagnostics.ambr | Removes name from diagnostics snapshot data. |
| use_nearest = True | ||
| return self.async_create_entry( | ||
| title=user_input[CONF_NAME], | ||
| title=f"{DEFAULT_NAME} ({latitude}, {longitude})", |
There was a problem hiding this comment.
Avoid embedding exact latitude/longitude in the config entry title to prevent unintentionally exposing precise location in UI and translated error messages that include config_entry.title; use a generic title (e.g., DEFAULT_NAME) and rely on unique_id, or only include a coarsely rounded/obfuscated location if differentiation is needed.
Suggested change
| title=f"{DEFAULT_NAME} ({latitude}, {longitude})", | |
| title=DEFAULT_NAME, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change
Proposed change
Removes
namefrom Airly config flow.Type of change
Additional information
airlyconfig flow #168915Checklist
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: