diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0e08052..794c552 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,8 +9,9 @@ "mounts": [ "source=${localWorkspaceFolder},target=/config/www/workspace,type=bind", "source=${localWorkspaceFolder}/test,target=/config/test,type=bind", + "source=${localWorkspaceFolder}/test,target=/config/www/test,type=bind", "source=${localWorkspaceFolder}/test/configuration.yaml,target=/config/configuration.yaml,type=bind", - "source=${localWorkspaceFolder}/custom_components,target=/config/custom_components,type=bind" + "source=${localWorkspaceFolder}/custom_components/favicon,target=/config/custom_components/favicon,type=bind" ], "runArgs": ["--env-file", "${localWorkspaceFolder}/test/.env"], "extensions": [ diff --git a/custom_components/favicon/__init__.py b/custom_components/favicon/__init__.py index 87d271a..9da17ed 100644 --- a/custom_components/favicon/__init__.py +++ b/custom_components/favicon/__init__.py @@ -158,15 +158,17 @@ def new_render(*args, **kwargs): if isinstance(view, frontend.IndexView): view._template_cache = None - frontend.MANIFEST_JSON["icons"] = data["manifest_icons"].copy() if "manifest" in icons: - frontend.MANIFEST_JSON["icons"] = icons["manifest"] + frontend.add_manifest_json_key("icons", icons["manifest"]) + else: + frontend.add_manifest_json_key("icons", data["manifest_icons"].copy()) - frontend.MANIFEST_JSON["name"] = "Home Assistant" - frontend.MANIFEST_JSON["short_name"] = "Assistant" if title: - frontend.MANIFEST_JSON["name"] = title - frontend.MANIFEST_JSON["short_name"] = title + frontend.add_manifest_json_key("name", title) + frontend.add_manifest_json_key("short_name", title) + else: + frontend.add_manifest_json_key("name", "Home Assistant") + frontend.add_manifest_json_key("short_name", "Assistant") return True @@ -174,7 +176,7 @@ def new_render(*args, **kwargs): def remove_hooks(hass): data = hass.data[DOMAIN] frontend.IndexView.get_template = data["get_template"] - frontend.MANIFEST_JSON["icons"] = data["manifest_icons"].copy() - frontend.MANIFEST_JSON["name"] = "Home Assistant" - frontend.MANIFEST_JSON["short_name"] = "Assistant" + frontend.add_manifest_json_key("icons", data["manifest_icons"].copy()) + frontend.add_manifest_json_key("name", "Home Assistant") + frontend.add_manifest_json_key("short_name", "Assistant") return True diff --git a/custom_components/favicon/manifest.json b/custom_components/favicon/manifest.json index ceecf51..da8e6f7 100644 --- a/custom_components/favicon/manifest.json +++ b/custom_components/favicon/manifest.json @@ -6,5 +6,5 @@ "codeowners": [], "requirements": [], "config_flow": true, - "version": "10.3" + "version": "10.4" } diff --git a/test/configuration.yaml b/test/configuration.yaml index dc1f897..5a2f22c 100644 --- a/test/configuration.yaml +++ b/test/configuration.yaml @@ -2,6 +2,5 @@ default_config: demo: - favicon: title: Test title