From 8285f42d267cdd799be00a0cafed6bea5454f932 Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Sun, 10 Jul 2022 14:16:16 -0600 Subject: [PATCH] Migrate IQVIA to new entity naming style (#74917) --- homeassistant/components/iqvia/__init__.py | 2 ++ homeassistant/components/iqvia/sensor.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/iqvia/__init__.py b/homeassistant/components/iqvia/__init__.py index 686f5b57f05..aad505e23c4 100644 --- a/homeassistant/components/iqvia/__init__.py +++ b/homeassistant/components/iqvia/__init__.py @@ -118,6 +118,8 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: class IQVIAEntity(CoordinatorEntity): """Define a base IQVIA entity.""" + _attr_has_entity_name = True + def __init__( self, coordinator: DataUpdateCoordinator, diff --git a/homeassistant/components/iqvia/sensor.py b/homeassistant/components/iqvia/sensor.py index d8c7ea317c8..033ed4e3031 100644 --- a/homeassistant/components/iqvia/sensor.py +++ b/homeassistant/components/iqvia/sensor.py @@ -79,17 +79,17 @@ TREND_SUBSIDING = "Subsiding" FORECAST_SENSOR_DESCRIPTIONS = ( SensorEntityDescription( key=TYPE_ALLERGY_FORECAST, - name="Allergy Index: Forecasted Average", + name="Allergy index: forecasted average", icon="mdi:flower", ), SensorEntityDescription( key=TYPE_ASTHMA_FORECAST, - name="Asthma Index: Forecasted Average", + name="Asthma index: forecasted average", icon="mdi:flower", ), SensorEntityDescription( key=TYPE_DISEASE_FORECAST, - name="Cold & Flu: Forecasted Average", + name="Cold & flu: forecasted average", icon="mdi:snowflake", ), ) @@ -97,29 +97,29 @@ FORECAST_SENSOR_DESCRIPTIONS = ( INDEX_SENSOR_DESCRIPTIONS = ( SensorEntityDescription( key=TYPE_ALLERGY_TODAY, - name="Allergy Index: Today", + name="Allergy index: today", icon="mdi:flower", state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key=TYPE_ALLERGY_TOMORROW, - name="Allergy Index: Tomorrow", + name="Allergy index: tomorrow", icon="mdi:flower", ), SensorEntityDescription( key=TYPE_ASTHMA_TODAY, - name="Asthma Index: Today", + name="Asthma index: today", icon="mdi:flower", state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key=TYPE_ASTHMA_TOMORROW, - name="Asthma Index: Tomorrow", + name="Asthma index: tomorrow", icon="mdi:flower", ), SensorEntityDescription( key=TYPE_DISEASE_TODAY, - name="Cold & Flu Index: Today", + name="Cold & flu index: today", icon="mdi:pill", state_class=SensorStateClass.MEASUREMENT, ),