Skip to content

Commit

Permalink
Add logging on disconnection/connection state change (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
raman325 authored Apr 15, 2021
1 parent 2448ee4 commit f2b06fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions custom_components/zoom/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,20 @@ async def _async_update(self, now) -> None:
# If API call succeeds but we are unavailable, that means we just regained
# connectivity to Zoom so we should do a single poll to update status.
if not self._available:
_LOGGER.info(
"We can reach Zoom again, polling for current status in case "
"we missed updates"
)
self._set_state(self._profile["presence_status"])
self._available = True
self.async_write_ha_state()
except:
# If API call fails we can assume we can't talk to Zoom
if self._available:
_LOGGER.warning(
"Unable to reach Zoom, we may miss status updates until we "
"can connect again"
)
self._available = False
self.async_write_ha_state()

Expand Down

0 comments on commit f2b06fd

Please sign in to comment.