Skip to content

Commit cb37e87

Browse files
authored
Merge pull request #485 from tuckshoprn/fix/deprecated-device-registry-lookup
Replace Deprecated Device Registry Lookup
2 parents 55c92b1 + f3451c2 commit cb37e87

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎custom_components/solis_modbus/sensors/solis_derived_sensor.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def _update_device_sw_version(self, protocol_version) -> None:
210210
if not serial:
211211
return
212212
dev_reg = dr.async_get(self.hass)
213-
device = dev_reg.async_get_device(identifiers={(DOMAIN, serial)})
213+
device = next(iter(dev_reg.async_get_devices(identifiers={(DOMAIN, serial)})), None)
214214
sw_version = f"Protocol {protocol_version}"
215215
if device and device.sw_version != sw_version:
216216
dev_reg.async_update_device(device.id, sw_version=sw_version)

0 commit comments

Comments
 (0)