Lots of changes and modernization. WIP

This commit is contained in:
2022-07-13 21:02:47 +00:00
parent 69e9642b4b
commit 466a5eb5e7
26 changed files with 1691 additions and 1185 deletions

View File

@@ -1,9 +1,15 @@
from .const import FRONTEND_SCRIPT_URL, DATA_EXTRA_MODULE_URL, SETTINGS_PANEL_URL
from homeassistant.components.frontend import add_extra_js_url
from .const import FRONTEND_SCRIPT_URL, SETTINGS_PANEL_URL
def setup_view(hass):
url_set = hass.data[DATA_EXTRA_MODULE_URL]
url_set.add(FRONTEND_SCRIPT_URL)
async def async_setup_view(hass):
hass.http.register_static_path(
FRONTEND_SCRIPT_URL,
hass.config.path("custom_components/browser_mod/browser_mod.js"),
)
add_extra_js_url(hass, FRONTEND_SCRIPT_URL)
hass.components.frontend.async_register_built_in_panel(
component_name="custom",
@@ -18,11 +24,6 @@ def setup_view(hass):
}
},
)
hass.http.register_static_path(
FRONTEND_SCRIPT_URL,
hass.config.path("custom_components/browser_mod/browser_mod.js"),
)
hass.http.register_static_path(
SETTINGS_PANEL_URL,
hass.config.path("custom_components/browser_mod/browser_mod_panel.js"),