mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Handle connection issues with Traccar (#78624)
This commit is contained in:
parent
98dd84f535
commit
0b4e4e81d4
@ -11,6 +11,7 @@ from pytraccar import (
|
|||||||
GeofenceModel,
|
GeofenceModel,
|
||||||
PositionModel,
|
PositionModel,
|
||||||
TraccarAuthenticationException,
|
TraccarAuthenticationException,
|
||||||
|
TraccarConnectionException,
|
||||||
TraccarException,
|
TraccarException,
|
||||||
)
|
)
|
||||||
from stringcase import camelcase
|
from stringcase import camelcase
|
||||||
@ -238,6 +239,9 @@ class TraccarScanner:
|
|||||||
except TraccarAuthenticationException:
|
except TraccarAuthenticationException:
|
||||||
_LOGGER.error("Authentication for Traccar failed")
|
_LOGGER.error("Authentication for Traccar failed")
|
||||||
return False
|
return False
|
||||||
|
except TraccarConnectionException as exception:
|
||||||
|
_LOGGER.error("Connection with Traccar failed - %s", exception)
|
||||||
|
return False
|
||||||
|
|
||||||
await self._async_update()
|
await self._async_update()
|
||||||
async_track_time_interval(self._hass, self._async_update, self._scan_interval)
|
async_track_time_interval(self._hass, self._async_update, self._scan_interval)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user