Migrate IQVIA to new entity naming style (#74917)

This commit is contained in:
Aaron Bach 2022-07-10 14:16:16 -06:00 committed by GitHub
parent d6ceebbb68
commit 8285f42d26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -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,

View File

@ -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,
),