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.
pull/35758/head
J. Nick Koston 2020-05-17 16:16:09 -05:00 committed by GitHub
parent 3815d7d74f
commit f085fb1499
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -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