diff --git a/homeassistant/components/gogogate2/sensor.py b/homeassistant/components/gogogate2/sensor.py index 9721f9b8722..743c8e7efc7 100644 --- a/homeassistant/components/gogogate2/sensor.py +++ b/homeassistant/components/gogogate2/sensor.py @@ -11,6 +11,7 @@ from homeassistant.const import ( DEVICE_CLASS_BATTERY, DEVICE_CLASS_TEMPERATURE, ENTITY_CATEGORY_DIAGNOSTIC, + PERCENTAGE, TEMP_CELSIUS, ) from homeassistant.core import HomeAssistant @@ -78,6 +79,7 @@ class DoorSensorBattery(DoorSensorEntity): super().__init__(config_entry, data_update_coordinator, door, unique_id) self._attr_device_class = DEVICE_CLASS_BATTERY self._attr_state_class = STATE_CLASS_MEASUREMENT + self._attr_native_unit_of_measurement = PERCENTAGE @property def name(self): diff --git a/tests/components/gogogate2/test_sensor.py b/tests/components/gogogate2/test_sensor.py index 1a59c5fd3c5..129fcac504f 100644 --- a/tests/components/gogogate2/test_sensor.py +++ b/tests/components/gogogate2/test_sensor.py @@ -172,6 +172,7 @@ async def test_sensor_update(gogogate2api_mock, hass: HomeAssistant) -> None: "friendly_name": "Door1 battery", "sensor_id": "ABCD", "state_class": "measurement", + "unit_of_measurement": "%", } temp_attributes = { "device_class": "temperature", @@ -248,6 +249,7 @@ async def test_availability(ismartgateapi_mock, hass: HomeAssistant) -> None: "friendly_name": "Door1 battery", "sensor_id": "ABCD", "state_class": "measurement", + "unit_of_measurement": "%", } temp_attributes = { "device_class": "temperature",