Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.airvisual.sensor Namespace Reference

Classes

class  AirVisualGeographySensor
 

Functions

None async_setup_entry (HomeAssistant hass, AirVisualConfigEntry entry, AddEntitiesCallback async_add_entities)
 

Variables

string ATTR_CITY = "city"
 
string ATTR_COUNTRY = "country"
 
string ATTR_POLLUTANT_SYMBOL = "pollutant_symbol"
 
string ATTR_POLLUTANT_UNIT = "pollutant_unit"
 
string ATTR_REGION = "region"
 
tuple GEOGRAPHY_SENSOR_DESCRIPTIONS
 
dictionary GEOGRAPHY_SENSOR_LOCALES = {"cn": "Chinese", "us": "U.S."}
 
dictionary POLLUTANT_LEVELS
 
dictionary POLLUTANT_UNITS
 
string SENSOR_KIND_AQI = "air_quality_index"
 
string SENSOR_KIND_LEVEL = "air_pollution_level"
 
string SENSOR_KIND_POLLUTANT = "main_pollutant"
 
string STATE_POLLUTANT_LABEL_CO = "co"
 
string STATE_POLLUTANT_LABEL_N2 = "n2"
 
string STATE_POLLUTANT_LABEL_O3 = "o3"
 
string STATE_POLLUTANT_LABEL_P1 = "p1"
 
string STATE_POLLUTANT_LABEL_P2 = "p2"
 
string STATE_POLLUTANT_LABEL_S2 = "s2"
 
string STATE_POLLUTANT_LEVEL_GOOD = "good"
 
string STATE_POLLUTANT_LEVEL_HAZARDOUS = "hazardous"
 
string STATE_POLLUTANT_LEVEL_MODERATE = "moderate"
 
string STATE_POLLUTANT_LEVEL_UNHEALTHY = "unhealthy"
 
string STATE_POLLUTANT_LEVEL_UNHEALTHY_SENSITIVE = "unhealthy_sensitive"
 
string STATE_POLLUTANT_LEVEL_VERY_UNHEALTHY = "very_unhealthy"
 

Detailed Description

Support for AirVisual air quality sensors.

Function Documentation

◆ async_setup_entry()

None homeassistant.components.airvisual.sensor.async_setup_entry ( HomeAssistant  hass,
AirVisualConfigEntry  entry,
AddEntitiesCallback  async_add_entities 
)
Set up AirVisual sensors based on a config entry.

Definition at line 108 of file sensor.py.

Variable Documentation

◆ ATTR_CITY

string homeassistant.components.airvisual.sensor.ATTR_CITY = "city"

Definition at line 33 of file sensor.py.

◆ ATTR_COUNTRY

string homeassistant.components.airvisual.sensor.ATTR_COUNTRY = "country"

Definition at line 34 of file sensor.py.

◆ ATTR_POLLUTANT_SYMBOL

string homeassistant.components.airvisual.sensor.ATTR_POLLUTANT_SYMBOL = "pollutant_symbol"

Definition at line 35 of file sensor.py.

◆ ATTR_POLLUTANT_UNIT

string homeassistant.components.airvisual.sensor.ATTR_POLLUTANT_UNIT = "pollutant_unit"

Definition at line 36 of file sensor.py.

◆ ATTR_REGION

string homeassistant.components.airvisual.sensor.ATTR_REGION = "region"

Definition at line 37 of file sensor.py.

◆ GEOGRAPHY_SENSOR_DESCRIPTIONS

tuple homeassistant.components.airvisual.sensor.GEOGRAPHY_SENSOR_DESCRIPTIONS
Initial value:
1 = (
2  SensorEntityDescription(
3  key=SENSOR_KIND_LEVEL,
4  name="Air pollution level",
5  device_class=SensorDeviceClass.ENUM,
6  options=[
7  "good",
8  "moderate",
9  "unhealthy",
10  "unhealthy_sensitive",
11  "very_unhealthy",
12  "hazardous",
13  ],
14  translation_key="pollutant_level",
15  ),
16  SensorEntityDescription(
17  key=SENSOR_KIND_AQI,
18  name="Air quality index",
19  device_class=SensorDeviceClass.AQI,
20  state_class=SensorStateClass.MEASUREMENT,
21  ),
22  SensorEntityDescription(
23  key=SENSOR_KIND_POLLUTANT,
24  name="Main pollutant",
25  device_class=SensorDeviceClass.ENUM,
26  options=["co", "n2", "o3", "p1", "p2", "s2"],
27  translation_key="pollutant_label",
28  ),
29 )

Definition at line 43 of file sensor.py.

◆ GEOGRAPHY_SENSOR_LOCALES

dictionary homeassistant.components.airvisual.sensor.GEOGRAPHY_SENSOR_LOCALES = {"cn": "Chinese", "us": "U.S."}

Definition at line 72 of file sensor.py.

◆ POLLUTANT_LEVELS

dictionary homeassistant.components.airvisual.sensor.POLLUTANT_LEVELS
Initial value:
1 = {
2  (0, 50): (STATE_POLLUTANT_LEVEL_GOOD, "mdi:emoticon-excited"),
3  (51, 100): (STATE_POLLUTANT_LEVEL_MODERATE, "mdi:emoticon-happy"),
4  (101, 150): (STATE_POLLUTANT_LEVEL_UNHEALTHY_SENSITIVE, "mdi:emoticon-neutral"),
5  (151, 200): (STATE_POLLUTANT_LEVEL_UNHEALTHY, "mdi:emoticon-sad"),
6  (201, 300): (STATE_POLLUTANT_LEVEL_VERY_UNHEALTHY, "mdi:emoticon-dead"),
7  (301, 1000): (STATE_POLLUTANT_LEVEL_HAZARDOUS, "mdi:biohazard"),
8 }

Definition at line 89 of file sensor.py.

◆ POLLUTANT_UNITS

dictionary homeassistant.components.airvisual.sensor.POLLUTANT_UNITS
Initial value:
1 = {
2  "co": CONCENTRATION_PARTS_PER_MILLION,
3  "n2": CONCENTRATION_PARTS_PER_BILLION,
4  "o3": CONCENTRATION_PARTS_PER_BILLION,
5  "p1": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
6  "p2": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
7  "s2": CONCENTRATION_PARTS_PER_BILLION,
8 }

Definition at line 98 of file sensor.py.

◆ SENSOR_KIND_AQI

string homeassistant.components.airvisual.sensor.SENSOR_KIND_AQI = "air_quality_index"

Definition at line 39 of file sensor.py.

◆ SENSOR_KIND_LEVEL

string homeassistant.components.airvisual.sensor.SENSOR_KIND_LEVEL = "air_pollution_level"

Definition at line 40 of file sensor.py.

◆ SENSOR_KIND_POLLUTANT

string homeassistant.components.airvisual.sensor.SENSOR_KIND_POLLUTANT = "main_pollutant"

Definition at line 41 of file sensor.py.

◆ STATE_POLLUTANT_LABEL_CO

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LABEL_CO = "co"

Definition at line 75 of file sensor.py.

◆ STATE_POLLUTANT_LABEL_N2

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LABEL_N2 = "n2"

Definition at line 76 of file sensor.py.

◆ STATE_POLLUTANT_LABEL_O3

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LABEL_O3 = "o3"

Definition at line 77 of file sensor.py.

◆ STATE_POLLUTANT_LABEL_P1

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LABEL_P1 = "p1"

Definition at line 78 of file sensor.py.

◆ STATE_POLLUTANT_LABEL_P2

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LABEL_P2 = "p2"

Definition at line 79 of file sensor.py.

◆ STATE_POLLUTANT_LABEL_S2

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LABEL_S2 = "s2"

Definition at line 80 of file sensor.py.

◆ STATE_POLLUTANT_LEVEL_GOOD

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LEVEL_GOOD = "good"

Definition at line 82 of file sensor.py.

◆ STATE_POLLUTANT_LEVEL_HAZARDOUS

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LEVEL_HAZARDOUS = "hazardous"

Definition at line 87 of file sensor.py.

◆ STATE_POLLUTANT_LEVEL_MODERATE

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LEVEL_MODERATE = "moderate"

Definition at line 83 of file sensor.py.

◆ STATE_POLLUTANT_LEVEL_UNHEALTHY

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LEVEL_UNHEALTHY = "unhealthy"

Definition at line 85 of file sensor.py.

◆ STATE_POLLUTANT_LEVEL_UNHEALTHY_SENSITIVE

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LEVEL_UNHEALTHY_SENSITIVE = "unhealthy_sensitive"

Definition at line 84 of file sensor.py.

◆ STATE_POLLUTANT_LEVEL_VERY_UNHEALTHY

string homeassistant.components.airvisual.sensor.STATE_POLLUTANT_LEVEL_VERY_UNHEALTHY = "very_unhealthy"

Definition at line 86 of file sensor.py.