core icon indicating copy to clipboard operation
core copied to clipboard

Replace Guardian `disable_ap` and `enable_ap` services with a switch

Open bachya opened this issue 3 years ago • 5 comments

Breaking change

The Guardian binary sensor that previously showed whether the onboard AP was enabled has been removed and replaced by a switch.

Proposed change

This PR follows up on https://github.com/home-assistant/core/pull/75028 and replaces two more Guardian services – guardian.disable_ap and guardian.enable_ap – with a switch.

CleanShot 2022-07-11 at 16 56 15

Since the services are now deprecated, I'll plan on making a breaking change after two versions from when this is merged. As-is, this PR is also a breaking change since it removes the previous binary sensor representing onboard AP status. I could have put everything into one breaking change, but I wanted to be consistent with https://github.com/home-assistant/core/pull/75028.

Users will be notified of both the service deprecation and the removed binary sensor by log entries and repairs issues.

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)
  • [x] Breaking change (fix/feature causing existing functionality to break)
  • [ ] Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: N/A
  • This PR is related to issue: N/A
  • Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/23374

Checklist

  • [x] The code change is tested and works locally.
  • [x] Local tests pass. Your PR cannot be merged unless tests pass
  • [x] There is no commented out code in this PR.
  • [x] I have followed the development checklist
  • [x] The code has been formatted using Black (black --fast homeassistant tests)
  • [ ] Tests have been added to verify that the new code works.

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 link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • [ ] Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • [ ] No score or internal
  • [ ] 🥈 Silver
  • [ ] 🥇 Gold
  • [ ] 🏆 Platinum

To help with the load of incoming pull requests:

bachya avatar Jul 11 '22 22:07 bachya

Users will be warned about the service deprecation in the logs – for example:

So this is not a breaking change, but a deprecation? (Please note, we have a different checkbox & label for that now and no longer marking it as breaking change during the deprecation phase).

frenck avatar Jul 12 '22 19:07 frenck

@frenck From the issue description:

Since the services are now deprecated, I'll plan on making a breaking change after two versions from when this is merged. As-is, this PR is also a breaking change since it removes the previous binary sensor representing onboard AP status. I could have put everything into one breaking change, but I wanted to be consistent with https://github.com/home-assistant/core/pull/75028.

The switch migration is a deprecation; the removal of the binary sensor is a breaking change. Happy to keep the binary sensor for now if you think a single breaking change later on (after the deprecation period) is better?

bachya avatar Jul 12 '22 19:07 bachya

Aah sorry, yeah that is fine 👍

frenck avatar Jul 12 '22 19:07 frenck

Marking as draft until https://github.com/home-assistant/core/pull/76336 is merged.

bachya avatar Aug 06 '22 04:08 bachya

Marking as draft while I address feedback on https://github.com/home-assistant/core/pull/76484 (lots of overlap).

bachya avatar Aug 09 '22 18:08 bachya

Can you leave the sensor around to only have a single deprecation point?

elupus avatar Sep 16 '22 23:09 elupus

Thanks for the nudge, @elupus! The latest leaves the binary sensor in place and adjusts the Repairs item to indicate that it will be removed in the future.

bachya avatar Sep 17 '22 17:09 bachya

Thanks, @elupus!

bachya avatar Sep 17 '22 21:09 bachya