Open
Conversation
The integration was incorrectly removing all entities associated with the device from the Home Assistant entity registry every time the device coordinator was set up (e.g., at boot or during reload). This included user-created helper entities associated with the device, causing them to lose their state and become unusable until manually updated. Removing the `remove_old_entity` call and method prevents this incorrect deletion and follows standard Home Assistant integration practices. Co-authored-by: l0rn <5889030+l0rn@users.noreply.github.com>
Removed the `remove_old_entity` logic that was purging the entity registry for the device on every setup. This was causing associated helpers (like utility meters) to be deleted and lose their connection to their source sensors. Co-authored-by: l0rn <5889030+l0rn@users.noreply.github.com>
Removed the `remove_old_entity` logic that was purging the entity registry for the device on every setup. This was causing associated helpers (like utility meters) to be deleted and lose their connection to their source sensors. This change prevents data loss of user customizations (names, areas) and ensures stable initialization of dependent entities. Targeted removal of unsupported entities is still handled by existing logic in entity.py. Co-authored-by: l0rn <5889030+l0rn@users.noreply.github.com>
…9509248165745000 Fix Refoss EM06P helpers initialization issue at boot
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.
This addresses my issue #6 where a utility_meter wouldn't find the refoss sensor after reboot and stays in a bad state until i "hard refresh it".
Google flash convinced me that this method is no good and home assistant would need the entities to stay. Honestly i have no clue if thats a good idea, but it did fix my problem. This problem was low-stake enough for me to accept this vibe coded fix and I don't want to go in this rabbit hole of integrations. Nevertheless I'll leave it here for the maintainers to evaluate if that is indeed a proper fix to the solution. Just close it if it's not.