fix aioasuswrt sometimes return empty lists (#18742)

* aioasuswrt sometimes return empty lists

* Bumping aioasuswrt to 1.1.12
This commit is contained in:
kennedyshead authored and Charles Garwood committed 2018-11-27 08:20:25 -05:00
1 parent 9d1b94c24a
commit 87507c4b6f
3 files changed
+6 -6

No files matched your search

+4 -4
View File
@@ -68,7 +68,7 @@ class AsuswrtRXSensor(AsuswrtSensor):
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)
@@ -86,7 +86,7 @@ class AsuswrtTXSensor(AsuswrtSensor):
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)
@@ -104,7 +104,7 @@ class AsuswrtTotalRXSensor(AsuswrtSensor):
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)
@@ -122,5 +122,5 @@ class AsuswrtTotalTXSensor(AsuswrtSensor):
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)