Explorar o código

Diagnostics: TuyaLocalDevice id property is unique_id.

Jason Rumney %!s(int64=3) %!d(string=hai) anos
pai
achega
38b4a4093e
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      custom_components/tuya_local/diagnostics.py

+ 3 - 1
custom_components/tuya_local/diagnostics.py

@@ -67,7 +67,9 @@ def _async_device_as_dict(
 
     device_registry = dr.async_get(hass)
     entity_registry = er.async_get(hass)
-    hass_device = device_registry.async_get_device(identifiers={(DOMAIN, device.id)})
+    hass_device = device_registry.async_get_device(
+        identifiers={(DOMAIN, device.unique_id)}
+    )
     if hass_device:
         data["home_assistant"] = {
             "name": hass_device.name,