mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Handle timeouts gracefully (#24752)
This commit is contained in:
parent
236820d093
commit
da57f92796
@ -2,6 +2,7 @@
|
|||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
|
import requests
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
@ -371,6 +372,9 @@ class ThermostatData:
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
_LOGGER.error("Error when getting homestatus.")
|
_LOGGER.error("Error when getting homestatus.")
|
||||||
return
|
return
|
||||||
|
except requests.exceptions.Timeout:
|
||||||
|
_LOGGER.warning("Timed out when connecting to Netatmo server.")
|
||||||
|
return
|
||||||
_LOGGER.debug("Following is the debugging output for homestatus:")
|
_LOGGER.debug("Following is the debugging output for homestatus:")
|
||||||
_LOGGER.debug(self.homestatus.rawData)
|
_LOGGER.debug(self.homestatus.rawData)
|
||||||
for room in self.homestatus.rooms:
|
for room in self.homestatus.rooms:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user