Просмотр исходного кода

Fix Lovelace resource registration: LovelaceData uses attribute not subscript

ZiB 4 месяцев назад
Родитель
Сommit
d1ee5c07cb
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      custom_components/zlock_slots/__init__.py

+ 1 - 1
custom_components/zlock_slots/__init__.py

@@ -67,7 +67,7 @@ async def _async_register_frontend(hass: HomeAssistant) -> None:
 
   try:
     lovelace = hass.data["lovelace"]
-    resources = lovelace["resources"]
+    resources = lovelace.resources
     if not any(r.get("url") == _CARD_URL for r in resources.async_items()):
       await resources.async_create_item({"res_type": "module", "url": _CARD_URL})
     _LOGGER.debug("Registered Lovelace resource: %s", _CARD_URL)