diff --git a/homeassistant/components/renault/sensor.py b/homeassistant/components/renault/sensor.py index 050c5a930f6..92deb3438de 100644 --- a/homeassistant/components/renault/sensor.py +++ b/homeassistant/components/renault/sensor.py @@ -190,6 +190,7 @@ SENSOR_TYPES: tuple[RenaultSensorEntityDescription[Any], ...] = ( key="charging_remaining_time", coordinator="battery", data_key="chargingRemainingTime", + device_class=SensorDeviceClass.DURATION, entity_class=RenaultSensor[KamereonVehicleBatteryStatusData], icon="mdi:timer", native_unit_of_measurement=UnitOfTime.MINUTES, diff --git a/tests/components/renault/const.py b/tests/components/renault/const.py index 4b2a7dfc72b..342ab803f33 100644 --- a/tests/components/renault/const.py +++ b/tests/components/renault/const.py @@ -198,6 +198,7 @@ MOCK_VEHICLES = { ATTR_UNIT_OF_MEASUREMENT: UnitOfPower.KILO_WATT, }, { + ATTR_DEVICE_CLASS: SensorDeviceClass.DURATION, ATTR_ENTITY_ID: "sensor.reg_number_charging_remaining_time", ATTR_ICON: "mdi:timer", ATTR_STATE: "145", @@ -433,6 +434,7 @@ MOCK_VEHICLES = { ATTR_UNIT_OF_MEASUREMENT: UnitOfPower.KILO_WATT, }, { + ATTR_DEVICE_CLASS: SensorDeviceClass.DURATION, ATTR_ENTITY_ID: "sensor.reg_number_charging_remaining_time", ATTR_ICON: "mdi:timer", ATTR_STATE: STATE_UNKNOWN, @@ -668,6 +670,7 @@ MOCK_VEHICLES = { ATTR_UNIT_OF_MEASUREMENT: UnitOfPower.KILO_WATT, }, { + ATTR_DEVICE_CLASS: SensorDeviceClass.DURATION, ATTR_ENTITY_ID: "sensor.reg_number_charging_remaining_time", ATTR_ICON: "mdi:timer", ATTR_STATE: "145", diff --git a/tests/components/renault/snapshots/test_sensor.ambr b/tests/components/renault/snapshots/test_sensor.ambr index b4e2f105b3b..46b231ac7ef 100644 --- a/tests/components/renault/snapshots/test_sensor.ambr +++ b/tests/components/renault/snapshots/test_sensor.ambr @@ -404,7 +404,7 @@ 'name': None, 'options': dict({ }), - 'original_device_class': None, + 'original_device_class': , 'original_icon': 'mdi:timer', 'original_name': 'Charging remaining time', 'platform': 'renault', @@ -811,6 +811,7 @@ }), StateSnapshot({ 'attributes': ReadOnlyDict({ + 'device_class': 'duration', 'friendly_name': 'REG-NUMBER Charging remaining time', 'icon': 'mdi:timer', 'state_class': , @@ -1100,7 +1101,7 @@ 'name': None, 'options': dict({ }), - 'original_device_class': None, + 'original_device_class': , 'original_icon': 'mdi:timer', 'original_name': 'Charging remaining time', 'platform': 'renault', @@ -1505,6 +1506,7 @@ }), StateSnapshot({ 'attributes': ReadOnlyDict({ + 'device_class': 'duration', 'friendly_name': 'REG-NUMBER Charging remaining time', 'icon': 'mdi:timer', 'state_class': , @@ -1790,7 +1792,7 @@ 'name': None, 'options': dict({ }), - 'original_device_class': None, + 'original_device_class': , 'original_icon': 'mdi:timer', 'original_name': 'Charging remaining time', 'platform': 'renault', @@ -2223,6 +2225,7 @@ }), StateSnapshot({ 'attributes': ReadOnlyDict({ + 'device_class': 'duration', 'friendly_name': 'REG-NUMBER Charging remaining time', 'icon': 'mdi:timer', 'state_class': , @@ -2803,7 +2806,7 @@ 'name': None, 'options': dict({ }), - 'original_device_class': None, + 'original_device_class': , 'original_icon': 'mdi:timer', 'original_name': 'Charging remaining time', 'platform': 'renault', @@ -3210,6 +3213,7 @@ }), StateSnapshot({ 'attributes': ReadOnlyDict({ + 'device_class': 'duration', 'friendly_name': 'REG-NUMBER Charging remaining time', 'icon': 'mdi:timer', 'state_class': , @@ -3499,7 +3503,7 @@ 'name': None, 'options': dict({ }), - 'original_device_class': None, + 'original_device_class': , 'original_icon': 'mdi:timer', 'original_name': 'Charging remaining time', 'platform': 'renault', @@ -3904,6 +3908,7 @@ }), StateSnapshot({ 'attributes': ReadOnlyDict({ + 'device_class': 'duration', 'friendly_name': 'REG-NUMBER Charging remaining time', 'icon': 'mdi:timer', 'state_class': , @@ -4189,7 +4194,7 @@ 'name': None, 'options': dict({ }), - 'original_device_class': None, + 'original_device_class': , 'original_icon': 'mdi:timer', 'original_name': 'Charging remaining time', 'platform': 'renault', @@ -4622,6 +4627,7 @@ }), StateSnapshot({ 'attributes': ReadOnlyDict({ + 'device_class': 'duration', 'friendly_name': 'REG-NUMBER Charging remaining time', 'icon': 'mdi:timer', 'state_class': ,