Skip to content

Commit

Permalink
wundergroundpws v0.8.1
Browse files Browse the repository at this point in the history
fixes for 2022.X deprecations
  • Loading branch information
dave_albright committed Dec 16, 2021
1 parent a3240fd commit d05a200
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Home Assistant custom component sensor for Weather Underground personal weather

:+1: If you find this product useful, feel free to buy me a beer: https://paypal.me/cytecheng

UPGRADE NOTE v0.8.0: Requires Home Assistant v 2021.8 or later
UPGRADE NOTE v0.8.X: Requires Home Assistant v 2021.8 or later

UPGRADE NOTE: numeric_precision must be added to your exisiting configuration.yaml for this sensor.
This adds the ability to display PWS data as integer or decimal. Valid options are 'none' or 'decimal'.
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v0.8.1
2021-12-16
fixes for 2022.X deprecations:
apply pr #75 - Drop loop= kwarg from async_timeout.timeout
replace device_state_attributes with extra_state_attributes in sensor.py

v0.8.0
2021-08-03
v0.8.0 requires Home Assistant 2021.8 or later
fix missing forecast unit_of_measure, issue #70
Expand Down
2 changes: 1 addition & 1 deletion custom_components/wundergroundpws/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "wundergroundpws",
"name": "Wundergroundpws",
"version": "0.8.0",
"version": "0.8.1",
"documentation": "https://github.com/cytech/Home-Assistant-wundergroundpws",
"issue_tracker": "https://github.com/cytech/Home-Assistant-wundergroundpws/issues/",
"requirements": [],
Expand Down
6 changes: 3 additions & 3 deletions custom_components/wundergroundpws/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def state(self):
return self._state

@property
def device_state_attributes(self):
def extra_state_attributes(self):
"""Return the state attributes."""
return self._attributes

Expand Down Expand Up @@ -535,7 +535,7 @@ async def async_update(self):
"""Get the latest data from WUnderground."""
headers = {'Accept-Encoding': 'gzip'}
try:
with async_timeout.timeout(10, loop=self._hass.loop):
with async_timeout.timeout(10):
response = await self._session.get(self._build_url(_RESOURCECURRENT), headers=headers)
result_current = await response.json()

Expand All @@ -546,7 +546,7 @@ async def async_update(self):

if result_current is None:
raise ValueError('NO CURRENT RESULT')
with async_timeout.timeout(10, loop=self._hass.loop):
with async_timeout.timeout(10):
response = await self._session.get(self._build_url(_RESOURCEFORECAST), headers=headers)
result_forecast = await response.json()

Expand Down

0 comments on commit d05a200

Please sign in to comment.