mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-10-27 16:10:49 +08:00
When get_props_async raises (cloud timeout, network error, etc.) the pending futures registered in self._get_prop_list stay unresolved forever. Subsequent get_prop_async calls with the same (did, siid, piid) key reuse the dead future via the cache lookup at the top of get_prop_async, so the integration never recovers from a single batch failure until Home Assistant is restarted. This was reproducible whenever the cloud HTTP request hung past the caller's wait_for timeout: every later poll for that key returned the same cancelled-but-still-pending future. Property entities driven by async_update silently stopped updating with no error in the logs. Wrap the await in try/except and fall through with results=[]. The existing fallback loop then drains every key still in props_req with set_result(None), unblocking awaiters and freeing the cache slot so the next aggregation cycle starts fresh.