diff --git a/custom_components/fullykiosk/sensor.py b/custom_components/fullykiosk/sensor.py index db020e0..285a422 100644 --- a/custom_components/fullykiosk/sensor.py +++ b/custom_components/fullykiosk/sensor.py @@ -1,7 +1,7 @@ """Fully Kiosk Browser sensor.""" import logging -from homeassistant.const import DEVICE_CLASS_BATTERY +from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE from homeassistant.helpers.entity import Entity from .const import DOMAIN, COORDINATOR @@ -53,6 +53,12 @@ def device_class(self): return DEVICE_CLASS_BATTERY return None + @property + def unit_of_measurement(self): + if self._sensor == "batteryLevel": + return PERCENTAGE + return None + @property def device_info(self): return {