mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
parent
74837dbf45
commit
6c91e04852
@ -209,7 +209,7 @@ class BroadlinkRMSwitch(SwitchDevice):
|
|||||||
return False
|
return False
|
||||||
if not self._auth():
|
if not self._auth():
|
||||||
return False
|
return False
|
||||||
return self._sendpacket(packet, max(0, retry-1))
|
return self._sendpacket(packet, retry-1)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _auth(self, retry=2):
|
def _auth(self, retry=2):
|
||||||
@ -218,7 +218,7 @@ class BroadlinkRMSwitch(SwitchDevice):
|
|||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
auth = False
|
auth = False
|
||||||
if not auth and retry > 0:
|
if not auth and retry > 0:
|
||||||
return self._auth(max(0, retry-1))
|
return self._auth(retry-1)
|
||||||
return auth
|
return auth
|
||||||
|
|
||||||
|
|
||||||
@ -241,7 +241,7 @@ class BroadlinkSP1Switch(BroadlinkRMSwitch):
|
|||||||
return False
|
return False
|
||||||
if not self._auth():
|
if not self._auth():
|
||||||
return False
|
return False
|
||||||
return self._sendpacket(packet, max(0, retry-1))
|
return self._sendpacket(packet, retry-1)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@ -275,7 +275,7 @@ class BroadlinkSP2Switch(BroadlinkSP1Switch):
|
|||||||
return
|
return
|
||||||
if not self._auth():
|
if not self._auth():
|
||||||
return
|
return
|
||||||
return self._update(max(0, retry-1))
|
return self._update(retry-1)
|
||||||
if state is None and retry > 0:
|
if state is None and retry > 0:
|
||||||
return self._update(max(0, retry-1))
|
return self._update(retry-1)
|
||||||
self._state = state
|
self._state = state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user