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.
This commit is contained in:
parent
3815d7d74f
commit
f085fb1499
1 changed files with 13 additions and 1 deletions
|
@ -371,6 +371,12 @@ class LIFXManager:
|
||||||
|
|
||||||
# Read initial state
|
# Read initial state
|
||||||
ack = AwaitAioLIFX().wait
|
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)
|
color_resp = await ack(bulb.get_color)
|
||||||
if color_resp:
|
if color_resp:
|
||||||
version_resp = await ack(bulb.get_version)
|
version_resp = await ack(bulb.get_version)
|
||||||
|
@ -459,7 +465,13 @@ class LIFXLight(LightEntity):
|
||||||
"manufacturer": "LIFX",
|
"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:
|
if model is not None:
|
||||||
info["model"] = model
|
info["model"] = model
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue