From c94ac01acc4cace9ef84847d27170627dde96b3e Mon Sep 17 00:00:00 2001 From: "Flamm, Matthew H" Date: Sat, 10 Aug 2019 01:26:51 +0100 Subject: [PATCH] address comments --- homeassistant/components/nws/weather.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/nws/weather.py b/homeassistant/components/nws/weather.py index 16d6fb8bc1d..dee82d8c6cf 100644 --- a/homeassistant/components/nws/weather.py +++ b/homeassistant/components/nws/weather.py @@ -39,6 +39,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 +from pynws import SimpleNWS + _LOGGER = logging.getLogger(__name__) ATTRIBUTION = "Data from National Weather Service/NOAA" @@ -161,7 +163,6 @@ def convert_condition(time, weather): async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the NWS weather platform.""" - from pynws import SimpleNWS latitude = config.get(CONF_LATITUDE, hass.config.latitude) longitude = config.get(CONF_LONGITUDE, hass.config.longitude) @@ -171,7 +172,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= if None in (latitude, longitude): _LOGGER.error("Latitude/longitude not set in Home Assistant config") - return ConfigEntryNotReady + return websession = async_get_clientsession(hass) # ID request as being from HA, pynws prepends the api_key in addition @@ -234,7 +235,6 @@ class NWSWeather(WeatherEntity): ) else: self._forecast = self.nws.forecast - return @property def attribution(self):