Remove LIFX bulb discovery from the inflight list if it fails to connect (#71673)

Remove the bulb discovery from the inflight list if it fails to connect

Signed-off-by: Avi Miller <me@dje.li>
pull/72107/head
Avi Miller 2022-05-13 21:30:44 +10:00 committed by Paulus Schoutsen
parent a3bd911ce3
commit 5fbc4b8dba
1 changed files with 2 additions and 0 deletions

View File

@ -419,6 +419,8 @@ class LIFXManager:
if color_resp is None or version_resp is None:
_LOGGER.error("Failed to connect to %s", bulb.ip_addr)
bulb.registered = False
if bulb.mac_addr in self.discoveries_inflight:
self.discoveries_inflight.pop(bulb.mac_addr)
else:
bulb.timeout = MESSAGE_TIMEOUT
bulb.retry_count = MESSAGE_RETRIES