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/71792/head
Avi Miller 2022-05-13 21:30:44 +10:00 committed by GitHub
parent 80d332ddf1
commit f487c04e02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

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