mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
minor broadlink fix (#6202)
This commit is contained in:
parent
e2e8b43902
commit
c4f4a9a158
@ -112,9 +112,9 @@ class BroadlinkData(object):
|
|||||||
self._device.timeout = timeout
|
self._device.timeout = timeout
|
||||||
self.update = Throttle(interval)(self._update)
|
self.update = Throttle(interval)(self._update)
|
||||||
if not self._auth():
|
if not self._auth():
|
||||||
_LOGGER.error("Failed to connect to device.")
|
_LOGGER.warning("Failed to connect to device.")
|
||||||
|
|
||||||
def _update(self, retry=2):
|
def _update(self, retry=3):
|
||||||
try:
|
try:
|
||||||
data = self._device.check_sensors_raw()
|
data = self._device.check_sensors_raw()
|
||||||
if (data is not None and data.get('humidity', 0) <= 100 and
|
if (data is not None and data.get('humidity', 0) <= 100 and
|
||||||
@ -127,11 +127,10 @@ class BroadlinkData(object):
|
|||||||
if retry < 1:
|
if retry < 1:
|
||||||
_LOGGER.error(error)
|
_LOGGER.error(error)
|
||||||
return
|
return
|
||||||
if retry < 1 or not self._auth():
|
if retry > 0 and self._auth():
|
||||||
return
|
|
||||||
self._update(retry-1)
|
self._update(retry-1)
|
||||||
|
|
||||||
def _auth(self, retry=2):
|
def _auth(self, retry=3):
|
||||||
try:
|
try:
|
||||||
auth = self._device.auth()
|
auth = self._device.auth()
|
||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user