Skip to content
Snippets Groups Projects
Unverified Commit 1b8bed93 authored by epenet's avatar epenet Committed by GitHub
Browse files

Use new DISTANCE and VOLUME device classes in Renault (#77488)

parent 01043078
No related branches found
No related tags found
No related merge requests found
...@@ -225,6 +225,7 @@ SENSOR_TYPES: tuple[RenaultSensorEntityDescription[Any], ...] = ( ...@@ -225,6 +225,7 @@ SENSOR_TYPES: tuple[RenaultSensorEntityDescription[Any], ...] = (
key="battery_autonomy", key="battery_autonomy",
coordinator="battery", coordinator="battery",
data_key="batteryAutonomy", data_key="batteryAutonomy",
device_class=SensorDeviceClass.DISTANCE,
entity_class=RenaultSensor[KamereonVehicleBatteryStatusData], entity_class=RenaultSensor[KamereonVehicleBatteryStatusData],
icon="mdi:ev-station", icon="mdi:ev-station",
name="Battery autonomy", name="Battery autonomy",
...@@ -265,6 +266,7 @@ SENSOR_TYPES: tuple[RenaultSensorEntityDescription[Any], ...] = ( ...@@ -265,6 +266,7 @@ SENSOR_TYPES: tuple[RenaultSensorEntityDescription[Any], ...] = (
key="mileage", key="mileage",
coordinator="cockpit", coordinator="cockpit",
data_key="totalMileage", data_key="totalMileage",
device_class=SensorDeviceClass.DISTANCE,
entity_class=RenaultSensor[KamereonVehicleCockpitData], entity_class=RenaultSensor[KamereonVehicleCockpitData],
icon="mdi:sign-direction", icon="mdi:sign-direction",
name="Mileage", name="Mileage",
...@@ -276,6 +278,7 @@ SENSOR_TYPES: tuple[RenaultSensorEntityDescription[Any], ...] = ( ...@@ -276,6 +278,7 @@ SENSOR_TYPES: tuple[RenaultSensorEntityDescription[Any], ...] = (
key="fuel_autonomy", key="fuel_autonomy",
coordinator="cockpit", coordinator="cockpit",
data_key="fuelAutonomy", data_key="fuelAutonomy",
device_class=SensorDeviceClass.DISTANCE,
entity_class=RenaultSensor[KamereonVehicleCockpitData], entity_class=RenaultSensor[KamereonVehicleCockpitData],
icon="mdi:gas-station", icon="mdi:gas-station",
name="Fuel autonomy", name="Fuel autonomy",
...@@ -288,6 +291,7 @@ SENSOR_TYPES: tuple[RenaultSensorEntityDescription[Any], ...] = ( ...@@ -288,6 +291,7 @@ SENSOR_TYPES: tuple[RenaultSensorEntityDescription[Any], ...] = (
key="fuel_quantity", key="fuel_quantity",
coordinator="cockpit", coordinator="cockpit",
data_key="fuelQuantity", data_key="fuelQuantity",
device_class=SensorDeviceClass.VOLUME,
entity_class=RenaultSensor[KamereonVehicleCockpitData], entity_class=RenaultSensor[KamereonVehicleCockpitData],
icon="mdi:fuel", icon="mdi:fuel",
name="Fuel quantity", name="Fuel quantity",
......
...@@ -132,6 +132,7 @@ MOCK_VEHICLES = { ...@@ -132,6 +132,7 @@ MOCK_VEHICLES = {
], ],
Platform.SENSOR: [ Platform.SENSOR: [
{ {
ATTR_DEVICE_CLASS: SensorDeviceClass.DISTANCE,
ATTR_ENTITY_ID: "sensor.reg_number_battery_autonomy", ATTR_ENTITY_ID: "sensor.reg_number_battery_autonomy",
ATTR_ICON: "mdi:ev-station", ATTR_ICON: "mdi:ev-station",
ATTR_STATE: "141", ATTR_STATE: "141",
...@@ -194,6 +195,7 @@ MOCK_VEHICLES = { ...@@ -194,6 +195,7 @@ MOCK_VEHICLES = {
ATTR_UNIT_OF_MEASUREMENT: TIME_MINUTES, ATTR_UNIT_OF_MEASUREMENT: TIME_MINUTES,
}, },
{ {
ATTR_DEVICE_CLASS: SensorDeviceClass.DISTANCE,
ATTR_ENTITY_ID: "sensor.reg_number_mileage", ATTR_ENTITY_ID: "sensor.reg_number_mileage",
ATTR_ICON: "mdi:sign-direction", ATTR_ICON: "mdi:sign-direction",
ATTR_STATE: "49114", ATTR_STATE: "49114",
...@@ -349,6 +351,7 @@ MOCK_VEHICLES = { ...@@ -349,6 +351,7 @@ MOCK_VEHICLES = {
], ],
Platform.SENSOR: [ Platform.SENSOR: [
{ {
ATTR_DEVICE_CLASS: SensorDeviceClass.DISTANCE,
ATTR_ENTITY_ID: "sensor.reg_number_battery_autonomy", ATTR_ENTITY_ID: "sensor.reg_number_battery_autonomy",
ATTR_ICON: "mdi:ev-station", ATTR_ICON: "mdi:ev-station",
ATTR_STATE: "128", ATTR_STATE: "128",
...@@ -411,6 +414,7 @@ MOCK_VEHICLES = { ...@@ -411,6 +414,7 @@ MOCK_VEHICLES = {
ATTR_UNIT_OF_MEASUREMENT: TIME_MINUTES, ATTR_UNIT_OF_MEASUREMENT: TIME_MINUTES,
}, },
{ {
ATTR_DEVICE_CLASS: SensorDeviceClass.DISTANCE,
ATTR_ENTITY_ID: "sensor.reg_number_mileage", ATTR_ENTITY_ID: "sensor.reg_number_mileage",
ATTR_ICON: "mdi:sign-direction", ATTR_ICON: "mdi:sign-direction",
ATTR_STATE: "49114", ATTR_STATE: "49114",
...@@ -566,6 +570,7 @@ MOCK_VEHICLES = { ...@@ -566,6 +570,7 @@ MOCK_VEHICLES = {
], ],
Platform.SENSOR: [ Platform.SENSOR: [
{ {
ATTR_DEVICE_CLASS: SensorDeviceClass.DISTANCE,
ATTR_ENTITY_ID: "sensor.reg_number_battery_autonomy", ATTR_ENTITY_ID: "sensor.reg_number_battery_autonomy",
ATTR_ICON: "mdi:ev-station", ATTR_ICON: "mdi:ev-station",
ATTR_STATE: "141", ATTR_STATE: "141",
...@@ -628,6 +633,7 @@ MOCK_VEHICLES = { ...@@ -628,6 +633,7 @@ MOCK_VEHICLES = {
ATTR_UNIT_OF_MEASUREMENT: TIME_MINUTES, ATTR_UNIT_OF_MEASUREMENT: TIME_MINUTES,
}, },
{ {
ATTR_DEVICE_CLASS: SensorDeviceClass.DISTANCE,
ATTR_ENTITY_ID: "sensor.reg_number_fuel_autonomy", ATTR_ENTITY_ID: "sensor.reg_number_fuel_autonomy",
ATTR_ICON: "mdi:gas-station", ATTR_ICON: "mdi:gas-station",
ATTR_STATE: "35", ATTR_STATE: "35",
...@@ -636,6 +642,7 @@ MOCK_VEHICLES = { ...@@ -636,6 +642,7 @@ MOCK_VEHICLES = {
ATTR_UNIT_OF_MEASUREMENT: LENGTH_KILOMETERS, ATTR_UNIT_OF_MEASUREMENT: LENGTH_KILOMETERS,
}, },
{ {
ATTR_DEVICE_CLASS: SensorDeviceClass.VOLUME,
ATTR_ENTITY_ID: "sensor.reg_number_fuel_quantity", ATTR_ENTITY_ID: "sensor.reg_number_fuel_quantity",
ATTR_ICON: "mdi:fuel", ATTR_ICON: "mdi:fuel",
ATTR_STATE: "3", ATTR_STATE: "3",
...@@ -644,6 +651,7 @@ MOCK_VEHICLES = { ...@@ -644,6 +651,7 @@ MOCK_VEHICLES = {
ATTR_UNIT_OF_MEASUREMENT: VOLUME_LITERS, ATTR_UNIT_OF_MEASUREMENT: VOLUME_LITERS,
}, },
{ {
ATTR_DEVICE_CLASS: SensorDeviceClass.DISTANCE,
ATTR_ENTITY_ID: "sensor.reg_number_mileage", ATTR_ENTITY_ID: "sensor.reg_number_mileage",
ATTR_ICON: "mdi:sign-direction", ATTR_ICON: "mdi:sign-direction",
ATTR_STATE: "5567", ATTR_STATE: "5567",
...@@ -749,6 +757,7 @@ MOCK_VEHICLES = { ...@@ -749,6 +757,7 @@ MOCK_VEHICLES = {
Platform.SELECT: [], Platform.SELECT: [],
Platform.SENSOR: [ Platform.SENSOR: [
{ {
ATTR_DEVICE_CLASS: SensorDeviceClass.DISTANCE,
ATTR_ENTITY_ID: "sensor.reg_number_fuel_autonomy", ATTR_ENTITY_ID: "sensor.reg_number_fuel_autonomy",
ATTR_ICON: "mdi:gas-station", ATTR_ICON: "mdi:gas-station",
ATTR_STATE: "35", ATTR_STATE: "35",
...@@ -757,6 +766,7 @@ MOCK_VEHICLES = { ...@@ -757,6 +766,7 @@ MOCK_VEHICLES = {
ATTR_UNIT_OF_MEASUREMENT: LENGTH_KILOMETERS, ATTR_UNIT_OF_MEASUREMENT: LENGTH_KILOMETERS,
}, },
{ {
ATTR_DEVICE_CLASS: SensorDeviceClass.VOLUME,
ATTR_ENTITY_ID: "sensor.reg_number_fuel_quantity", ATTR_ENTITY_ID: "sensor.reg_number_fuel_quantity",
ATTR_ICON: "mdi:fuel", ATTR_ICON: "mdi:fuel",
ATTR_STATE: "3", ATTR_STATE: "3",
...@@ -765,6 +775,7 @@ MOCK_VEHICLES = { ...@@ -765,6 +775,7 @@ MOCK_VEHICLES = {
ATTR_UNIT_OF_MEASUREMENT: VOLUME_LITERS, ATTR_UNIT_OF_MEASUREMENT: VOLUME_LITERS,
}, },
{ {
ATTR_DEVICE_CLASS: SensorDeviceClass.DISTANCE,
ATTR_ENTITY_ID: "sensor.reg_number_mileage", ATTR_ENTITY_ID: "sensor.reg_number_mileage",
ATTR_ICON: "mdi:sign-direction", ATTR_ICON: "mdi:sign-direction",
ATTR_STATE: "5567", ATTR_STATE: "5567",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment