import logging import homeassistant.components.frontend from homeassistant.components.frontend import _frontend_root _LOGGER = logging.getLogger(__name__) DOMAIN = "favicon" async def async_setup(hass, config): favicon = config[DOMAIN].get('favicon') apple = config[DOMAIN].get('apple') title = config[DOMAIN].get('title') if favicon or apple or title: get_template = homeassistant.components.frontend.IndexView.get_template def new_get_template(self): tpl = get_template(self) render = tpl.render def new_render(*args, **kwargs): text = render(*args, **kwargs) if favicon: text = text.replace("/static/icons/favicon.ico", favicon) if apple: text = text.replace("/static/icons/favicon-apple-180x180.png", apple) if title: text = text.replace("