This commit is contained in:
Steven Looman 2018-09-02 17:03:31 +02:00
parent a4a175440b
commit 85c40d29ee

View File

@ -133,7 +133,7 @@ class PerSecondIGDSensor(Entity):
@property @property
def unit(self) -> str: def unit(self) -> str:
"""Unit we are measuring in.""" """Get unit we are measuring in."""
raise NotImplementedError() raise NotImplementedError()
@property @property
@ -196,11 +196,11 @@ class KBytePerSecondIGDSensor(PerSecondIGDSensor):
@property @property
def unit(self) -> str: def unit(self) -> str:
"""Unit we are measuring in.""" """Get unit we are measuring in."""
return 'kbyte' return 'kbyte'
async def _async_fetch_value(self) -> float: async def _async_fetch_value(self) -> float:
"""""" """Fetch value from device."""
if self._direction == IN: if self._direction == IN:
return await self._device.async_get_total_bytes_received() return await self._device.async_get_total_bytes_received()
@ -220,11 +220,11 @@ class PacketsPerSecondIGDSensor(PerSecondIGDSensor):
@property @property
def unit(self) -> str: def unit(self) -> str:
"""Unit we are measuring in.""" """Get unit we are measuring in."""
return 'packets' return 'packets'
async def _async_fetch_value(self) -> float: async def _async_fetch_value(self) -> float:
"""""" """Fetch value from device."""
if self._direction == IN: if self._direction == IN:
return await self._device.async_get_total_packets_received() return await self._device.async_get_total_packets_received()