Add icon translations to Subaru (#112252)

This commit is contained in:
Joost Lekkerkerker 2024-03-05 08:47:28 +01:00 committed by GitHub
parent 3005c92585
commit 4f9d8d3048
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 6 deletions

View File

@ -47,7 +47,7 @@ class SubaruDeviceTracker(
):
"""Class for Subaru device tracker."""
_attr_icon = "mdi:car"
_attr_translation_key = "location"
_attr_has_entity_name = True
_attr_name = None

View File

@ -0,0 +1,29 @@
{
"entity": {
"device_tracker": {
"location": {
"default": "mdi:car"
}
},
"sensor": {
"odometer": {
"default": "mdi:road-variant"
},
"average_fuel_consumption": {
"default": "mdi:leaf"
},
"range": {
"default": "mdi:gas-station"
},
"fuel_level": {
"default": "mdi:gas-station"
},
"ev_range": {
"default": "mdi:ev-station"
}
}
},
"services": {
"unlock_specific_door": "mdi:lock-open-variant"
}
}

View File

@ -57,7 +57,6 @@ SAFETY_SENSORS = [
key=sc.ODOMETER,
translation_key="odometer",
device_class=SensorDeviceClass.DISTANCE,
icon="mdi:road-variant",
native_unit_of_measurement=UnitOfLength.KILOMETERS,
state_class=SensorStateClass.TOTAL_INCREASING,
),
@ -68,7 +67,6 @@ API_GEN_2_SENSORS = [
SensorEntityDescription(
key=sc.AVG_FUEL_CONSUMPTION,
translation_key="average_fuel_consumption",
icon="mdi:leaf",
native_unit_of_measurement=FUEL_CONSUMPTION_LITERS_PER_HUNDRED_KILOMETERS,
state_class=SensorStateClass.MEASUREMENT,
),
@ -76,7 +74,6 @@ API_GEN_2_SENSORS = [
key=sc.DIST_TO_EMPTY,
translation_key="range",
device_class=SensorDeviceClass.DISTANCE,
icon="mdi:gas-station",
native_unit_of_measurement=UnitOfLength.KILOMETERS,
state_class=SensorStateClass.MEASUREMENT,
),
@ -115,7 +112,6 @@ API_GEN_3_SENSORS = [
SensorEntityDescription(
key=sc.REMAINING_FUEL_PERCENT,
translation_key="fuel_level",
icon="mdi:gas-station",
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
),
@ -127,7 +123,6 @@ EV_SENSORS = [
key=sc.EV_DISTANCE_TO_EMPTY,
translation_key="ev_range",
device_class=SensorDeviceClass.DISTANCE,
icon="mdi:ev-station",
native_unit_of_measurement=UnitOfLength.MILES,
state_class=SensorStateClass.MEASUREMENT,
),