Skip to content

Commit

Permalink
Fix for 21.5
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Apr 29, 2021
1 parent 88175d2 commit bba2855
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
20 changes: 11 additions & 9 deletions custom_components/favicon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,25 @@ 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


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
2 changes: 1 addition & 1 deletion custom_components/favicon/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"codeowners": [],
"requirements": [],
"config_flow": true,
"version": "10.3"
"version": "10.4"
}
1 change: 0 additions & 1 deletion test/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ default_config:

demo:


favicon:
title: Test title

0 comments on commit bba2855

Please sign in to comment.