Skip to content

Commit

Permalink
Fix for Home Assistant 0.115
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Sep 17, 2020
1 parent fb304a0 commit 9e53012
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 4 deletions.
12 changes: 8 additions & 4 deletions custom_components/favicon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,14 @@ def new_render(*args, **kwargs):
<script type="module">
customElements.whenDefined('ha-sidebar').then(() => {{
const Sidebar = customElements.get('ha-sidebar');
const firstUpdated = Sidebar.prototype.firstUpdated;
Sidebar.prototype.firstUpdated = function(changedProps) {{
firstUpdated.bind(this)(changedProps);
this.shadowRoot.querySelector(".menu .title").innerHTML = "{title}";
const render = Sidebar.prototype.render;
Sidebar.prototype.render = function() {{
const retval = render.bind(this)();
retval.values.forEach((val, i, arr) => {{
if (val === "Home Assistant")
retval.values[i] = "{title}";
}});
return retval;
}}
}});
Expand Down
7 changes: 7 additions & 0 deletions test/configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default_config:

demo:


favicon:
title: Test title
39 changes: 39 additions & 0 deletions test/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
x-files: &x-files
- ../custom_components:/config/custom_components
- ./configuration.yaml:/config/configuration.yaml
- ./www:/config/www

x-command: &x-command |
bash -c '
mkdir /config/www/
curl https://raw.githubusercontent.com/thomasloven/lovelace-card-mod/master/card-mod.js --output /config/www/card-mod.js &&
hass --script ensure_config -c /config &&
hass --script auth -c /config add dev dev &&
echo "
{
\"data\": {
\"done\": [
\"user\",
\"core_config\",
\"integration\"
]
},
\"key\": \"onboarding\",
\"version\": 3
}
" > /config/.storage/onboarding &&
hass -v -c /config'
version: '3.5'
services:
prod: &base_service
image: homeassistant/home-assistant:latest
volumes: *x-files
ports:
- "5001:8123"
command: *x-command

dev:
<<: *base_service
image: homeassistant/home-assistant:dev
9 changes: 9 additions & 0 deletions test/www/card-mod.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9e53012

Please sign in to comment.