Convert nws integration to component configuration (#31398)

* convert nws to component configuration

* add more debug logging

* remove assumed state

* move initialization of data into init

* refactor update logic

* use forecast success for checking available entities

* Split unique_id into more usable pieces.

use a base_unique_id for each entry.  Add domain for signaling to entities.  Each entity in each platform can use base_unique_id to form individual unique_id's.

* Revert "move initialization of data into init"

This reverts commit 09eb0220469285b10f0500f5f6def67415931a81.

* add silver quality scale to manifest

* unsubscribe listener in will_remove_from_hass

* initialize _unsub_listener in __init__

* use async_on_remove

* remove scan interval from configuration

* Use better name

Co-Authored-By: J. Nick Koston <nick@koston.org>

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
MatthewFlammandJ. Nick Koston authored and GitHub committed 2020-04-08 10:22:25 -05:00
1 parent f5b7deda72
commit a3e84791c6
8 files changed
+496 -273

No files matched your search

+4
View File
@@ -1,4 +1,5 @@
"""Helpers for interacting with pynws."""
from homeassistant.components.nws.const import DOMAIN
from homeassistant.components.nws.weather import ATTR_FORECAST_PRECIP_PROB
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
@@ -14,6 +15,7 @@ from homeassistant.components.weather import (
ATTR_WEATHER_WIND_SPEED,
)
from homeassistant.const import (
CONF_API_KEY,
LENGTH_KILOMETERS,
LENGTH_METERS,
LENGTH_MILES,
@@ -27,6 +29,8 @@ from homeassistant.util.distance import convert as convert_distance
from homeassistant.util.pressure import convert as convert_pressure
from homeassistant.util.temperature import convert as convert_temperature
MINIMAL_CONFIG = {DOMAIN: [{CONF_API_KEY: "test"}]}
DEFAULT_STATIONS = ["ABC", "XYZ"]
DEFAULT_OBSERVATION = {