Do not use AQI device class for CAQI sensor in Airly integration (#79402)

pull/79416/head
Maciej Bieniek 2022-10-01 14:33:11 +00:00 committed by GitHub
parent b27f0c70be
commit 8ff12eacd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -68,7 +68,7 @@ class AirlySensorEntityDescription(SensorEntityDescription):
SENSOR_TYPES: tuple[AirlySensorEntityDescription, ...] = (
AirlySensorEntityDescription(
key=ATTR_API_CAQI,
device_class=SensorDeviceClass.AQI,
icon="mdi:air-filter",
name=ATTR_API_CAQI,
native_unit_of_measurement="CAQI",
),

View File

@ -11,6 +11,7 @@ from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_DEVICE_CLASS,
ATTR_ENTITY_ID,
ATTR_ICON,
ATTR_UNIT_OF_MEASUREMENT,
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
PERCENTAGE,
@ -37,7 +38,7 @@ async def test_sensor(hass, aioclient_mock):
assert state.state == "7"
assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "CAQI"
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.AQI
assert state.attributes.get(ATTR_ICON) == "mdi:air-filter"
entry = registry.async_get("sensor.home_caqi")
assert entry