From 4a38be2924b107e55653046560940205982a5ede Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Sun, 10 Jul 2022 14:12:56 -0600 Subject: [PATCH] Migrate WattTime to new entity naming style (#74916) --- homeassistant/components/watttime/sensor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/watttime/sensor.py b/homeassistant/components/watttime/sensor.py index 41842c6ed70..040753d97e8 100644 --- a/homeassistant/components/watttime/sensor.py +++ b/homeassistant/components/watttime/sensor.py @@ -35,14 +35,14 @@ SENSOR_TYPE_REALTIME_EMISSIONS_PERCENT = "percent" REALTIME_EMISSIONS_SENSOR_DESCRIPTIONS = ( SensorEntityDescription( key=SENSOR_TYPE_REALTIME_EMISSIONS_MOER, - name="Marginal Operating Emissions Rate", + name="Marginal operating emissions rate", icon="mdi:blur", native_unit_of_measurement=f"{MASS_POUNDS} CO2/MWh", state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key=SENSOR_TYPE_REALTIME_EMISSIONS_PERCENT, - name="Relative Marginal Emissions Intensity", + name="Relative marginal emissions intensity", icon="mdi:blur", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, @@ -67,6 +67,8 @@ async def async_setup_entry( class RealtimeEmissionsSensor(CoordinatorEntity, SensorEntity): """Define a realtime emissions sensor.""" + _attr_has_entity_name = True + def __init__( self, coordinator: DataUpdateCoordinator,