Use device class translations in airvisual pro (#96472)

pull/96476/head
Joost Lekkerkerker 2023-07-13 15:05:55 +02:00 committed by GitHub
parent d025b97bb9
commit b8bc958070
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 7 deletions

View File

@ -43,7 +43,6 @@ class AirVisualProMeasurementDescription(
SENSOR_DESCRIPTIONS = ( SENSOR_DESCRIPTIONS = (
AirVisualProMeasurementDescription( AirVisualProMeasurementDescription(
key="air_quality_index", key="air_quality_index",
name="Air quality index",
device_class=SensorDeviceClass.AQI, device_class=SensorDeviceClass.AQI,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda settings, status, measurements: measurements[ value_fn=lambda settings, status, measurements: measurements[
@ -52,7 +51,6 @@ SENSOR_DESCRIPTIONS = (
), ),
AirVisualProMeasurementDescription( AirVisualProMeasurementDescription(
key="battery_level", key="battery_level",
name="Battery",
device_class=SensorDeviceClass.BATTERY, device_class=SensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
@ -60,7 +58,6 @@ SENSOR_DESCRIPTIONS = (
), ),
AirVisualProMeasurementDescription( AirVisualProMeasurementDescription(
key="carbon_dioxide", key="carbon_dioxide",
name="C02",
device_class=SensorDeviceClass.CO2, device_class=SensorDeviceClass.CO2,
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -68,7 +65,6 @@ SENSOR_DESCRIPTIONS = (
), ),
AirVisualProMeasurementDescription( AirVisualProMeasurementDescription(
key="humidity", key="humidity",
name="Humidity",
device_class=SensorDeviceClass.HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
value_fn=lambda settings, status, measurements: measurements["humidity"], value_fn=lambda settings, status, measurements: measurements["humidity"],
@ -91,7 +87,6 @@ SENSOR_DESCRIPTIONS = (
), ),
AirVisualProMeasurementDescription( AirVisualProMeasurementDescription(
key="particulate_matter_2_5", key="particulate_matter_2_5",
name="PM 2.5",
device_class=SensorDeviceClass.PM25, device_class=SensorDeviceClass.PM25,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -99,7 +94,6 @@ SENSOR_DESCRIPTIONS = (
), ),
AirVisualProMeasurementDescription( AirVisualProMeasurementDescription(
key="temperature", key="temperature",
name="Temperature",
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS, native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
@ -107,7 +101,6 @@ SENSOR_DESCRIPTIONS = (
), ),
AirVisualProMeasurementDescription( AirVisualProMeasurementDescription(
key="voc", key="voc",
name="VOC",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS, device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,