Skip to content

Commit

Permalink
Added logging to _async_validate_connection
Browse files Browse the repository at this point in the history
  • Loading branch information
toreamun committed Jul 7, 2020
1 parent 493590e commit b406815
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/amshan/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,12 @@ async def _async_validate_connection(
try:
transport, _ = await connection_factory()
except TimeoutError:
_LOGGER.debug("Timeout when connecting to HAN-port: %s", ex)
self.errors[VALIDATION_ERROR_BASE] = VALIDATION_ERROR_TIMEOUT_CONNECT
return None
except Exception as ex:
_LOGGER.exception("Unexpected error connecting to HAN-port: %s", ex)
raise

try:
return await self._async_get_meter_info(measure_queue)
Expand Down

0 comments on commit b406815

Please sign in to comment.