Skip to content

Commit

Permalink
Merge pull request #28 from pawkakol1/fix/issue-27
Browse files Browse the repository at this point in the history
Update sensor.py
  • Loading branch information
pawkakol1 authored Oct 21, 2022
2 parents 01c3428 + bbc2e31 commit 84eda76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/worlds_air_quality_index/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ def update(self) -> None:
self._updateLastTime = self._requester.GetUpdateLastTime()

if self._resType == 'aqi':
if _data["data"]["aqi"] == "-":
if self._data["data"]["aqi"] == "-":
_LOGGER.warning("aqi value from json waqi api was undefined ('-' value)")
self._state = 0
else:
self._state = int(_data["data"]["aqi"])
self._state = int(self._data["data"]["aqi"])
elif self._resType == 't':
if self._tempUnit == TEMP_FAHRENHEIT:
self._state = 9.0 * float(self._data["data"]["iaqi"]['t']["v"]) / 5.0 + 32.0
Expand Down

0 comments on commit 84eda76

Please sign in to comment.