Handle timeouts gracefully (#24752)
This commit is contained in:
1 parent
b47b555c4f
commit
ca4c6ffe8d
1 file changed
+4
@@ -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:
|
||||||
|
|||||||
Reference in new issue
Block a user