-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ESPHome entities not being removed when the ESPHome config removes an entire platform #141708
Conversation
Hey there @OttoWinter, @jesserockz, @kbx81, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Still doesn't fix it. Need to write some more tests as it means there is more wrong |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @bdraco 👍
../Frenck
Thanks |
Proposed change
TLDR: if all entities for a specific platform i.e.
sensor
were removed from the ESPHome config, they would not get removed in HA. Remove only worked if there was at least one entity on that platform remaining.If all entities on a platform were removed from the ESPHome config, the callback for the platform would not fire which meant the entities would not get removed. Make sure the callback fires with an empty list when everything on the platform is removed.
Everything worked correctly if there was at least one entity remaining on the platform. The problem would only happen if all the entities for a platform were removed from the ESPHome config.
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: