Fix device entities not showing up after reconnection #257
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 fixes the issue of switch entities not becoming available after reconnecting my mss310EU plugs v6
This should fix missing availability after reconnection for any device that brings both entities that push state and that do not push state on their own
The issue with the mss310 plugs results from the
_async_polling_callback
never triggering a full device state update after a reconnection. I think this happens because the device has some power measurement entities that push updates right after rejoining, which leads tothis.lastupdate
being updated despite some entities state being missing and corresponding entities staying marked as unavailable.Left as draft for now to discuss if there is maybe a better approach.
Re-querying Appliance.System.All when a device is recovering from being offline should not break things, however i cannot test this with other devices and this most likely also leads to querying full state twice on the first initialization..
I'd be grateful if someone more knowledgeable with the architecture can chime in.