Skip to content

Commit

Permalink
fix: catch TimeoutError when calling HA (fixes #19) (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoesbergen authored Jan 31, 2023
1 parent 2a367d0 commit 41c1d31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion presence-detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _ha_seen(self, client: str, seen: bool = True) -> bool:
headers={"Authorization": f"Bearer {self._settings.hass_token}"},
)
self._logger.log(f"API Response: {response.content!r}", is_debug=True)
except (URLError, HTTPError) as ex:
except (URLError, HTTPError, TimeoutError) as ex:
self._logger.log(str(ex), is_debug=True)
# Force full sync when HA returns
self._full_sync_counter = 0
Expand Down

0 comments on commit 41c1d31

Please sign in to comment.