Skip to content

Commit

Permalink
Merge pull request #83 from Snuffy2/Change-to-async_forward_entry_setups
Browse files Browse the repository at this point in the history
Change to async_forward_entry_setups
  • Loading branch information
finity69x2 authored Jul 14, 2024
2 parents 8127c8d + a327fa5 commit 7a42068
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 2 additions & 5 deletions custom_components/nws_alerts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
""" NWS Alerts """

import logging
from datetime import timedelta

import aiohttp
from async_timeout import timeout
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -79,10 +79,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
COORDINATOR: coordinator,
}

for platform in PLATFORMS:
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(config_entry, platform)
)
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
return True


Expand Down
4 changes: 3 additions & 1 deletion custom_components/nws_alerts/const.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from homeassistant.const import Platform

# API
API_ENDPOINT = "https://api.weather.gov"
USER_AGENT = "Home Assistant"
Expand All @@ -23,4 +25,4 @@
PLATFORM = "sensor"
ATTRIBUTION = "Data provided by Weather.gov"
COORDINATOR = "coordinator"
PLATFORMS = ["sensor"]
PLATFORMS = [Platform.SENSOR]

0 comments on commit 7a42068

Please sign in to comment.