djtimca / hagooglewifi

Home Assistant integration for Google Wifi systems.
Apache License 2.0
81 stars 27 forks source link

[custom_components.googlewifi] Unexpected error fetching GoogleWifi data: 'operationState' #30

Closed droopanu closed 3 years ago

droopanu commented 3 years ago

Every now and then all devices go unavailable for a little while, and I can see the following error in logs:

2021-04-15 15:06:43 ERROR (MainThread) [custom_components.googlewifi] Unexpected error fetching GoogleWifi data: 'operationState' Traceback (most recent call last): File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/update_coordinator.py", line 173, in _async_refresh self.data = await self._async_update_data() File "/home/homeassistant/.homeassistant/custom_components/googlewifi/init.py", line 171, in _async_update_data system_data = await self.api.get_systems() File "/srv/homeassistant/lib/python3.8/site-packages/googlewifi/init.py", line 191, in get_systems return await self.structure_systems(response) File "/srv/homeassistant/lib/python3.8/site-packages/googlewifi/init.py", line 284, in structure_systems sensitive_info = await self.get_sensitive_info(system_id=this_system["id"], station_ids=station_ids) File "/srv/homeassistant/lib/python3.8/site-packages/googlewifi/init.py", line 616, in get_sensitive_info status = status["operationState"] KeyError: 'operationState'

djtimca commented 3 years ago

This happens periodically if the Google APIs return invalid data. Because of the nature of this integration using the back door to those cloud APIs it will not be perfect on those.