Update pynws to v0.10.1 (#30662)

* update to pynws 0.10.1

* remove unneeded raw json files

* move test helper module to const
This commit is contained in:
MatthewFlamm authored and Paulus Schoutsen committed 2020-01-15 12:01:47 -08:00
1 parent 3899c6ae27
commit b8feaba5cb
12 files changed
+262 -1679

No files matched your search

+1 -1
View File
@@ -4,5 +4,5 @@
"documentation": "https://www.home-assistant.io/integrations/nws",
"dependencies": [],
"codeowners": ["@MatthewFlamm"],
"requirements": ["pynws==0.8.1"]
"requirements": ["pynws==0.10.1"]
}
+12 -3
View File
@@ -177,7 +177,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
websession = async_get_clientsession(hass)
# ID request as being from HA, pynws prepends the api_key in addition
api_key_ha = f"{api_key} homeassistant"
nws = SimpleNWS(latitude, longitude, api_key_ha, mode, websession)
nws = SimpleNWS(latitude, longitude, api_key_ha, websession)
_LOGGER.debug("Setting up station: %s", station)
try:
@@ -226,15 +226,24 @@ class NWSWeather(WeatherEntity):
)
else:
self.observation = self.nws.observation
_LOGGER.debug("Observation: %s", self.observation)
_LOGGER.debug("Updating forecast")
try:
await self.nws.update_forecast()
if self.mode == "daynight":
await self.nws.update_forecast()
else:
await self.nws.update_forecast_hourly()
except ERRORS as status:
_LOGGER.error(
"Error updating forecast from station %s: %s", self.nws.station, status
)
return
self._forecast = self.nws.forecast
if self.mode == "daynight":
self._forecast = self.nws.forecast
else:
self._forecast = self.nws.forecast_hourly
_LOGGER.debug("Forecast: %s", self._forecast)
_LOGGER.debug("Finished updating")
@property
def attribution(self):