mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Plug file leak on LIFX unregister (#7031)
* Plug file leak on LIFX unregister The aiolifx 0.4.4 release closes its socket when the unregister callback is called. This plugs a file descriptor leak but also means that we must be careful to not use the device after it goes unavailable. Also, when a light reappears, it has a new device that must be used. * Do not test self.available in service calls The core will learn to handle that.
This commit is contained in:
parent
07bb64815d
commit
f099aee69a
@ -26,7 +26,7 @@ import homeassistant.helpers.config_validation as cv
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
REQUIREMENTS = ['aiolifx==0.4.2']
|
REQUIREMENTS = ['aiolifx==0.4.4']
|
||||||
|
|
||||||
UDP_BROADCAST_PORT = 56700
|
UDP_BROADCAST_PORT = 56700
|
||||||
|
|
||||||
@ -84,6 +84,7 @@ class LIFXManager(object):
|
|||||||
entity = self.entities[device.mac_addr]
|
entity = self.entities[device.mac_addr]
|
||||||
_LOGGER.debug("%s register AGAIN", entity.ipaddr)
|
_LOGGER.debug("%s register AGAIN", entity.ipaddr)
|
||||||
entity.available = True
|
entity.available = True
|
||||||
|
entity.device = device
|
||||||
self.hass.async_add_job(entity.async_update_ha_state())
|
self.hass.async_add_job(entity.async_update_ha_state())
|
||||||
else:
|
else:
|
||||||
_LOGGER.debug("%s register NEW", device.ip_addr)
|
_LOGGER.debug("%s register NEW", device.ip_addr)
|
||||||
|
@ -44,7 +44,7 @@ aiodns==1.1.1
|
|||||||
aiohttp_cors==0.5.2
|
aiohttp_cors==0.5.2
|
||||||
|
|
||||||
# homeassistant.components.light.lifx
|
# homeassistant.components.light.lifx
|
||||||
aiolifx==0.4.2
|
aiolifx==0.4.4
|
||||||
|
|
||||||
# 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