Skip to content

Conversation

@emontnemery
Copy link
Contributor

Proposed change

When removing an entry from entity registry, also remove it from the state machine.

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

Checklist

  • 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
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

@emontnemery emontnemery requested a review from a team as a code owner February 25, 2020 18:37
@probot-home-assistant probot-home-assistant bot added core small-pr PRs with less than 30 lines. labels Feb 25, 2020
@emontnemery emontnemery changed the title Remove state when entity is removed from registry RFC: Remove state when entity is removed from registry Feb 25, 2020
@balloob
Copy link
Member

balloob commented Feb 25, 2020

I think that this change makes sense:

Entity registry controls an entity. Updates to the registry already update name or remove the entity if disabled_by is set. This change makes sense.

We do have to make sure to check all async_removed_from_registry calls to make sure that this is handled correctly.

@codecov
Copy link

codecov bot commented Feb 25, 2020

Codecov Report

❗ No coverage uploaded for pull request base (dev@2365e2e). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##             dev   #32184   +/-   ##
======================================
  Coverage       ?   94.75%           
======================================
  Files          ?      768           
  Lines          ?    55647           
  Branches       ?        0           
======================================
  Hits           ?    52726           
  Misses         ?     2921           
  Partials       ?        0
Impacted Files Coverage Δ
homeassistant/helpers/entity.py 97.65% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2365e2e...9c0a07a. Read the comment docs.

@stale
Copy link

stale bot commented Mar 26, 2020

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale bot added the stale label Mar 26, 2020
@balloob
Copy link
Member

balloob commented Mar 26, 2020

Let's merge it and see how it goes.

@stale stale bot removed the stale label Mar 26, 2020
@balloob balloob changed the title RFC: Remove state when entity is removed from registry Remove state when entity is removed from registry Mar 26, 2020
@balloob balloob merged commit 867630a into home-assistant:dev Mar 26, 2020
@lock lock bot locked and limited conversation to collaborators Mar 28, 2020
@emontnemery emontnemery deleted the remove_state_on_remove_from_registry branch June 10, 2020 18:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed core small-pr PRs with less than 30 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants