From f085fb1499873f7ba39c37f4e5263a5a74b0bc7a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 17 May 2020 16:16:09 -0500 Subject: [PATCH] Set lifx device sw_version (#35739) This change solves an issue where homekit would think the firmware was out of date on the bulb because no version was set. --- homeassistant/components/lifx/light.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/lifx/light.py b/homeassistant/components/lifx/light.py index f36b64f2397..2b7629cdaf2 100644 --- a/homeassistant/components/lifx/light.py +++ b/homeassistant/components/lifx/light.py @@ -371,6 +371,12 @@ class LIFXManager: # Read initial state ack = AwaitAioLIFX().wait + + # Used to populate sw_version + # no need to wait as we do not + # need it until later + bulb.get_hostfirmware() + color_resp = await ack(bulb.get_color) if color_resp: version_resp = await ack(bulb.get_version) @@ -459,7 +465,13 @@ class LIFXLight(LightEntity): "manufacturer": "LIFX", } - model = aiolifx().products.product_map.get(self.bulb.product) + version = self.bulb.host_firmware_version + if version is not None: + info["sw_version"] = version + + product_map = aiolifx().products.product_map + + model = product_map.get(self.bulb.product) or self.bulb.product if model is not None: info["model"] = model