Add entity name translations to CO2signal (#90877)

This commit is contained in:
Michael 2023-04-06 10:39:49 +02:00 committed by GitHub
parent e8cbf439e5
commit 03e9cb233f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -35,13 +35,13 @@ class CO2SensorEntityDescription(SensorEntityDescription):
SENSORS = (
CO2SensorEntityDescription(
key="carbonIntensity",
name="CO2 intensity",
translation_key="carbon_intensity",
unique_id="co2intensity",
# No unit, it's extracted from response.
),
CO2SensorEntityDescription(
key="fossilFuelPercentage",
name="Grid fossil fuel percentage",
translation_key="fossil_fuel_percentage",
native_unit_of_measurement=PERCENTAGE,
),
)

View file

@ -30,5 +30,11 @@
"unknown": "[%key:common::config_flow::error::unknown%]",
"api_ratelimit": "API Ratelimit exceeded"
}
},
"entity": {
"sensor": {
"carbon_intensity": { "name": "CO2 intensity" },
"fossil_fuel_percentage": { "name": "Grid fossil fuel percentage" }
}
}
}