Skip to content

Commit

Permalink
fix aioasuswrt sometimes return empty lists (#18742)
Browse files Browse the repository at this point in the history
* aioasuswrt sometimes return empty lists

* Bumping aioasuswrt to 1.1.12
  • Loading branch information
kennedyshead authored and cgarwood committed Nov 27, 2018
1 parent 9d1b94c commit 87507c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/asuswrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.discovery import async_load_platform

REQUIREMENTS = ['aioasuswrt==1.1.11']
REQUIREMENTS = ['aioasuswrt==1.1.12']

_LOGGER = logging.getLogger(__name__)

Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/sensor/asuswrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def unit_of_measurement(self):
async def async_update(self):
"""Fetch new state data for the sensor."""
await super().async_update()
if self._speed is not None:
if self._speed:
self._state = round(self._speed[0] / 125000, 2)


Expand All @@ -86,7 +86,7 @@ def unit_of_measurement(self):
async def async_update(self):
"""Fetch new state data for the sensor."""
await super().async_update()
if self._speed is not None:
if self._speed:
self._state = round(self._speed[1] / 125000, 2)


Expand All @@ -104,7 +104,7 @@ def unit_of_measurement(self):
async def async_update(self):
"""Fetch new state data for the sensor."""
await super().async_update()
if self._rates is not None:
if self._rates:
self._state = round(self._rates[0] / 1000000000, 1)


Expand All @@ -122,5 +122,5 @@ def unit_of_measurement(self):
async def async_update(self):
"""Fetch new state data for the sensor."""
await super().async_update()
if self._rates is not None:
if self._rates:
self._state = round(self._rates[1] / 1000000000, 1)
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ abodepy==0.14.0
afsapi==0.0.4

# homeassistant.components.asuswrt
aioasuswrt==1.1.11
aioasuswrt==1.1.12

# homeassistant.components.device_tracker.automatic
aioautomatic==0.6.5
Expand Down

0 comments on commit 87507c4

Please sign in to comment.