Kaynağa Gözat

Diagnostics: retrieve hass_data the way we store it.

Original was copied from tuya integration, on the assumption that this was
generic internal HA standard, but there is nothing there for tuya_local.
We add our data by Tuya device id, not HA device id.
Jason Rumney 3 yıl önce
ebeveyn
işleme
a5f3744118
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      custom_components/tuya_local/diagnostics.py

+ 1 - 1
custom_components/tuya_local/diagnostics.py

@@ -34,7 +34,7 @@ def _async_get_diagnostics(
     device: DeviceEntry | None = None,
 ) -> dict[str, Any]:
     """Return diagnostics for a tuya-local config entry."""
-    hass_data = hass.data[DOMAIN][entry.entry_id]
+    hass_data = hass.data[DOMAIN][entry.data["device_id"]]
 
     data = {
         "name": entry["title"],