diff --git a/homeassistant/components/geniushub/sensor.py b/homeassistant/components/geniushub/sensor.py index 06237b6e8d5..22d95be079e 100644 --- a/homeassistant/components/geniushub/sensor.py +++ b/homeassistant/components/geniushub/sensor.py @@ -47,6 +47,9 @@ async def async_setup_platform( class GeniusBattery(GeniusDevice, SensorEntity): """Representation of a Genius Hub sensor.""" + _attr_device_class = SensorDeviceClass.BATTERY + _attr_native_unit_of_measurement = PERCENTAGE + def __init__(self, broker, device, state_attr) -> None: """Initialize the sensor.""" super().__init__(broker, device) @@ -80,16 +83,6 @@ class GeniusBattery(GeniusDevice, SensorEntity): return icon - @property - def device_class(self) -> SensorDeviceClass: - """Return the device class of the sensor.""" - return SensorDeviceClass.BATTERY - - @property - def native_unit_of_measurement(self) -> str: - """Return the unit of measurement of the sensor.""" - return PERCENTAGE - @property def native_value(self) -> str: """Return the state of the sensor."""