Skip to content

Remove name from Airly config flow#169145

Draft
bieniu wants to merge 2 commits intohome-assistant:devfrom
bieniu:airly-remove-name
Draft

Remove name from Airly config flow#169145
bieniu wants to merge 2 commits intohome-assistant:devfrom
bieniu:airly-remove-name

Conversation

@bieniu
Copy link
Copy Markdown
Member

@bieniu bieniu commented Apr 25, 2026

Breaking change

Proposed change

Removes name from Airly config flow.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

bieniu and others added 2 commits April 25, 2026 13:29
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_NAME from the Airly config flow schema and from test fixtures.
  • Introduces DEFAULT_NAME and updates sensors to fall back when legacy name is 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})",
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copilot uses AI. Check for mistakes.
@bieniu bieniu marked this pull request as draft April 25, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove name field from airly config flow

2 participants