Add device_class to Renault charging remaining time (#98393)
* Add device_class on charging remaining time Set `device_class to `duration` on the `charging_remaining_time` entity in the Renault integration. I had some issues showing this property on my dashboard, and setting this fixed it. The recommendation to open an issue against the original integration in these kinds of cases came from [here](https://community.home-assistant.io/t/how-to-format-a-card-to-show-hours-instead-of-seconds/425473/7). * Update test const to add duration * fix other cars * Update test_sensor.ambr * add duration in ambr
This commit is contained in:
parent
c010b97abf
commit
8efb9dad7e
3 changed files with 16 additions and 6 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue