1
mirror of https://github.com/home-assistant/core synced 2024-09-25 00:41:32 +02:00

Add firmware and hardware version to WiZ (#66017)

This commit is contained in:
J. Nick Koston 2022-02-07 12:23:08 -06:00 committed by GitHub
parent 480ce84b8a
commit 721d711762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 5 deletions

View File

@ -46,8 +46,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
_LOGGER.debug("Get bulb with IP: %s", ip_address)
bulb = wizlight(ip_address)
try:
await bulb.getMac()
scenes = await bulb.getSupportedScenes()
await bulb.getMac()
# ValueError gets thrown if the bulb type
# cannot be determined on the first try.
# This is likely because way the library

View File

@ -23,11 +23,16 @@ class WizToggleEntity(CoordinatorEntity, ToggleEntity):
bulb_type: BulbType = self._device.bulbtype
self._attr_unique_id = self._device.mac
self._attr_name = name
hw_data = bulb_type.name.split("_")
board = hw_data.pop(0)
model = hw_data.pop(0)
self._attr_device_info = DeviceInfo(
connections={(CONNECTION_NETWORK_MAC, self._device.mac)},
name=name,
manufacturer="WiZ",
model=bulb_type.name,
model=model,
hw_version=f"{board} {hw_data[0]}" if hw_data else board,
sw_version=bulb_type.fw_version,
)
@callback

View File

@ -8,7 +8,7 @@
],
"dependencies": ["network"],
"documentation": "https://www.home-assistant.io/integrations/wiz",
"requirements": ["pywizlight==0.5.1"],
"requirements": ["pywizlight==0.5.2"],
"iot_class": "local_push",
"codeowners": ["@sbidy"]
}

View File

@ -2051,7 +2051,7 @@ pywemo==0.7.0
pywilight==0.0.70
# homeassistant.components.wiz
pywizlight==0.5.1
pywizlight==0.5.2
# homeassistant.components.xeoma
pyxeoma==1.4.1

View File

@ -1276,7 +1276,7 @@ pywemo==0.7.0
pywilight==0.0.70
# homeassistant.components.wiz
pywizlight==0.5.1
pywizlight==0.5.2
# homeassistant.components.zerproc
pyzerproc==0.4.8