Use "kB" and "s" as UPnP/IGD units (#29552)

For consistency with various existing components, and they're more
commonly used and compact than "kbyte" and "sec".
This commit is contained in:
Ville Skyttä 2019-12-06 19:54:11 +02:00 committed by Fabian Affolter
parent c9415ab75d
commit d257fff9ce

View file

@ -189,7 +189,7 @@ class PerSecondUPnPIGDSensor(UpnpSensor):
@property
def unit_of_measurement(self) -> str:
"""Return the unit of measurement of this entity, if any."""
return f"{self.unit}/sec"
return f"{self.unit}/s"
def _is_overflowed(self, new_value) -> bool:
"""Check if value has overflowed."""
@ -222,7 +222,7 @@ class KBytePerSecondUPnPIGDSensor(PerSecondUPnPIGDSensor):
@property
def unit(self) -> str:
"""Get unit we are measuring in."""
return "kbyte"
return "kB"
async def _async_fetch_value(self) -> float:
"""Fetch value from device."""