mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix LIFX unregister races (#6723)
* Fix LIFX unregister races If the initial state request never got a response, we tried to unregister a device that was not yet registered. Also, aiolifx 0.4.2 has an "unregister" race fix. * Update requirements
This commit is contained in:
parent
4ee8be52fe
commit
ba3c9f9765
@ -25,7 +25,7 @@ import homeassistant.helpers.config_validation as cv
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
REQUIREMENTS = ['aiolifx==0.4.1.post1']
|
REQUIREMENTS = ['aiolifx==0.4.2']
|
||||||
|
|
||||||
UDP_BROADCAST_PORT = 56700
|
UDP_BROADCAST_PORT = 56700
|
||||||
|
|
||||||
@ -95,6 +95,7 @@ class LIFXManager(object):
|
|||||||
@callback
|
@callback
|
||||||
def unregister(self, device):
|
def unregister(self, device):
|
||||||
"""Callback for disappearing bulb."""
|
"""Callback for disappearing bulb."""
|
||||||
|
if device.mac_addr in self.entities:
|
||||||
entity = self.entities[device.mac_addr]
|
entity = self.entities[device.mac_addr]
|
||||||
_LOGGER.debug("%s unregister", entity.ipaddr)
|
_LOGGER.debug("%s unregister", entity.ipaddr)
|
||||||
entity.available = False
|
entity.available = False
|
||||||
|
@ -41,7 +41,7 @@ aiodns==1.1.1
|
|||||||
aiohttp_cors==0.5.0
|
aiohttp_cors==0.5.0
|
||||||
|
|
||||||
# homeassistant.components.light.lifx
|
# homeassistant.components.light.lifx
|
||||||
aiolifx==0.4.1.post1
|
aiolifx==0.4.2
|
||||||
|
|
||||||
# homeassistant.components.camera.amcrest
|
# homeassistant.components.camera.amcrest
|
||||||
# homeassistant.components.sensor.amcrest
|
# homeassistant.components.sensor.amcrest
|
||||||
|
Loading…
x
Reference in New Issue
Block a user