diff --git a/README.md b/README.md index 8ac5d5f..ce3537b 100644 --- a/README.md +++ b/README.md @@ -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'. diff --git a/changelog.md b/changelog.md index b007738..3f6f8e1 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/custom_components/wundergroundpws/manifest.json b/custom_components/wundergroundpws/manifest.json index c5077f3..4889ab1 100644 --- a/custom_components/wundergroundpws/manifest.json +++ b/custom_components/wundergroundpws/manifest.json @@ -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": [], diff --git a/custom_components/wundergroundpws/sensor.py b/custom_components/wundergroundpws/sensor.py index 8ab8fe7..1f3c84c 100644 --- a/custom_components/wundergroundpws/sensor.py +++ b/custom_components/wundergroundpws/sensor.py @@ -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 @@ -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() @@ -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()