custom_components/bahmcloud_store/__init__.py aktualisiert
This commit is contained in:
@@ -1,11 +1,15 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from .core import BCSCore
|
from .core import BCSCore
|
||||||
from .views import StaticAssetsView, BCSApiView, BCSCustomRepoView, BCSReadmeView
|
from .views import (
|
||||||
|
StaticAssetsView,
|
||||||
|
BCSApiView,
|
||||||
|
BCSCustomRepoView,
|
||||||
|
BCSReadmeView,
|
||||||
|
)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -13,13 +17,14 @@ DOMAIN = "bahmcloud_store"
|
|||||||
|
|
||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, config: dict) -> bool:
|
async def async_setup(hass: HomeAssistant, config: dict) -> bool:
|
||||||
core = BCSCore(hass)
|
# Übergib config korrekt an den Core
|
||||||
|
core = BCSCore(hass, config)
|
||||||
await core.async_setup()
|
await core.async_setup()
|
||||||
|
|
||||||
hass.data.setdefault(DOMAIN, {})
|
hass.data.setdefault(DOMAIN, {})
|
||||||
hass.data[DOMAIN]["core"] = core
|
hass.data[DOMAIN]["core"] = core
|
||||||
|
|
||||||
# HTTP views
|
# Register HTTP views (wie in der stabilen Version)
|
||||||
hass.http.register_view(StaticAssetsView())
|
hass.http.register_view(StaticAssetsView())
|
||||||
hass.http.register_view(BCSApiView(core))
|
hass.http.register_view(BCSApiView(core))
|
||||||
hass.http.register_view(BCSCustomRepoView(core))
|
hass.http.register_view(BCSCustomRepoView(core))
|
||||||
|
|||||||
Reference in New Issue
Block a user