MindrustUK / Heatmiser-for-home-assistant

Heatmiser Neo-Hub / Neostat support for home-assistant.io
87 stars 33 forks source link

Cache NeoStat state for existing entities #184

Closed knyar closed 1 week ago

knyar commented 1 month ago

If NeoHub stops reporting data for a device, keep using its previous state and mark it as unavailable.

Fixes #183

MindrustUK commented 2 weeks ago

From my testing I'd say that work done by @ocrease in the dev branch makes this redundant. Unless there's any further activity to keep this alive I'll close by the end of November.

knyar commented 1 week ago

Yeah it's unfortunate that I hit this right when you were doing a large refactor and moving to another branch.

Looking at the dev branch, I think it might still assume that a device, once created, will never be removed. For example, seems like this code would hit a similar KeyError if at some point the hub stops reporting the device: https://github.com/MindrustUK/Heatmiser-for-home-assistant/blob/3fea81653fe0b03e80c62e87bb30b98023a3884e/custom_components/heatmiserneo/entity.py#L63-L68

But I am happy to try running the dev branch and create another PR against dev if I encounter this issue again.

ocrease commented 1 week ago

@knyar have a look at #216, I think it fixes this issue