Skip to content

Commit

Permalink
Fix config entry setup warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hmmbob authored and thomasloven committed Jul 31, 2024
1 parent 6ae04b2 commit c241257
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions custom_components/browser_mod/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import homeassistant.helpers.config_validation as cv
from homeassistant.const import Platform

from .store import BrowserModStore
from .mod_view import async_setup_view
Expand All @@ -12,6 +13,14 @@

CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)

PLATFORMS = [
Platform.SENSOR,
Platform.BINARY_SENSOR,
Platform.LIGHT,
Platform.MEDIA_PLAYER,
Platform.CAMERA
]

async def async_setup(hass, config):

store = BrowserModStore(hass)
Expand All @@ -28,10 +37,7 @@ async def async_setup(hass, config):

async def async_setup_entry(hass, config_entry):

for domain in ["sensor", "binary_sensor", "light", "media_player", "camera"]:
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(config_entry, domain)
)
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)

await async_setup_connection(hass)
await async_setup_view(hass)
Expand Down

0 comments on commit c241257

Please sign in to comment.