mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Fix deleting and readding nws entry (#34555)
* fix deleting and readding nws * Clean up * Fix variable name clash Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
561b033ebb
commit
116f7934d3
@ -53,7 +53,6 @@ def base_unique_id(latitude, longitude):
|
||||
|
||||
async def async_setup(hass: HomeAssistant, config: dict):
|
||||
"""Set up the National Weather Service (NWS) component."""
|
||||
hass.data.setdefault(DOMAIN, {})
|
||||
return True
|
||||
|
||||
|
||||
@ -93,8 +92,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
||||
update_method=nws_data.update_forecast_hourly,
|
||||
update_interval=DEFAULT_SCAN_INTERVAL,
|
||||
)
|
||||
|
||||
hass.data[DOMAIN][entry.entry_id] = {
|
||||
nws_hass_data = hass.data.setdefault(DOMAIN, {})
|
||||
nws_hass_data[entry.entry_id] = {
|
||||
NWS_DATA: nws_data,
|
||||
COORDINATOR_OBSERVATION: coordinator_observation,
|
||||
COORDINATOR_FORECAST: coordinator_forecast,
|
||||
|
Loading…
x
Reference in New Issue
Block a user