2019-10-04 11:58:29 +00:00
|
|
|
"""Constants for Airly integration."""
|
2021-05-07 14:47:52 +00:00
|
|
|
from __future__ import annotations
|
2021-02-05 11:41:36 +00:00
|
|
|
|
2021-05-07 14:47:52 +00:00
|
|
|
from typing import Final
|
2021-02-05 11:41:36 +00:00
|
|
|
|
2021-05-31 14:00:58 +00:00
|
|
|
from homeassistant.components.sensor import ATTR_STATE_CLASS, STATE_CLASS_MEASUREMENT
|
2021-05-07 14:47:52 +00:00
|
|
|
from homeassistant.const import (
|
2021-05-20 09:34:32 +00:00
|
|
|
ATTR_DEVICE_CLASS,
|
|
|
|
ATTR_ICON,
|
2021-05-07 14:47:52 +00:00
|
|
|
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
|
|
|
DEVICE_CLASS_HUMIDITY,
|
|
|
|
DEVICE_CLASS_PRESSURE,
|
|
|
|
DEVICE_CLASS_TEMPERATURE,
|
|
|
|
PERCENTAGE,
|
|
|
|
PRESSURE_HPA,
|
|
|
|
TEMP_CELSIUS,
|
|
|
|
)
|
2021-02-05 11:41:36 +00:00
|
|
|
|
2021-05-07 14:47:52 +00:00
|
|
|
from .model import SensorDescription
|
|
|
|
|
|
|
|
ATTR_API_ADVICE: Final = "ADVICE"
|
|
|
|
ATTR_API_CAQI: Final = "CAQI"
|
|
|
|
ATTR_API_CAQI_DESCRIPTION: Final = "DESCRIPTION"
|
|
|
|
ATTR_API_CAQI_LEVEL: Final = "LEVEL"
|
|
|
|
ATTR_API_HUMIDITY: Final = "HUMIDITY"
|
|
|
|
ATTR_API_PM10: Final = "PM10"
|
|
|
|
ATTR_API_PM10_LIMIT: Final = "PM10_LIMIT"
|
|
|
|
ATTR_API_PM10_PERCENT: Final = "PM10_PERCENT"
|
2021-05-20 09:34:32 +00:00
|
|
|
ATTR_API_PM1: Final = "PM1"
|
2021-05-07 14:47:52 +00:00
|
|
|
ATTR_API_PM25: Final = "PM25"
|
|
|
|
ATTR_API_PM25_LIMIT: Final = "PM25_LIMIT"
|
|
|
|
ATTR_API_PM25_PERCENT: Final = "PM25_PERCENT"
|
|
|
|
ATTR_API_PRESSURE: Final = "PRESSURE"
|
|
|
|
ATTR_API_TEMPERATURE: Final = "TEMPERATURE"
|
2021-05-20 09:34:32 +00:00
|
|
|
ATTR_LABEL: Final = "label"
|
|
|
|
ATTR_UNIT: Final = "unit"
|
2021-05-07 14:47:52 +00:00
|
|
|
|
|
|
|
ATTRIBUTION: Final = "Data provided by Airly"
|
|
|
|
CONF_USE_NEAREST: Final = "use_nearest"
|
|
|
|
DEFAULT_NAME: Final = "Airly"
|
|
|
|
DOMAIN: Final = "airly"
|
|
|
|
LABEL_ADVICE: Final = "advice"
|
|
|
|
MANUFACTURER: Final = "Airly sp. z o.o."
|
|
|
|
MAX_UPDATE_INTERVAL: Final = 90
|
|
|
|
MIN_UPDATE_INTERVAL: Final = 5
|
|
|
|
NO_AIRLY_SENSORS: Final = "There are no Airly sensors in this area yet."
|
|
|
|
|
|
|
|
SENSOR_TYPES: dict[str, SensorDescription] = {
|
|
|
|
ATTR_API_PM1: {
|
2021-05-20 09:34:32 +00:00
|
|
|
ATTR_DEVICE_CLASS: None,
|
|
|
|
ATTR_ICON: "mdi:blur",
|
|
|
|
ATTR_LABEL: ATTR_API_PM1,
|
|
|
|
ATTR_UNIT: CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
2021-05-31 14:00:58 +00:00
|
|
|
ATTR_STATE_CLASS: STATE_CLASS_MEASUREMENT,
|
2021-05-07 14:47:52 +00:00
|
|
|
},
|
|
|
|
ATTR_API_HUMIDITY: {
|
2021-05-20 09:34:32 +00:00
|
|
|
ATTR_DEVICE_CLASS: DEVICE_CLASS_HUMIDITY,
|
|
|
|
ATTR_ICON: None,
|
|
|
|
ATTR_LABEL: ATTR_API_HUMIDITY.capitalize(),
|
|
|
|
ATTR_UNIT: PERCENTAGE,
|
2021-05-31 14:00:58 +00:00
|
|
|
ATTR_STATE_CLASS: STATE_CLASS_MEASUREMENT,
|
2021-05-07 14:47:52 +00:00
|
|
|
},
|
|
|
|
ATTR_API_PRESSURE: {
|
2021-05-20 09:34:32 +00:00
|
|
|
ATTR_DEVICE_CLASS: DEVICE_CLASS_PRESSURE,
|
|
|
|
ATTR_ICON: None,
|
|
|
|
ATTR_LABEL: ATTR_API_PRESSURE.capitalize(),
|
|
|
|
ATTR_UNIT: PRESSURE_HPA,
|
2021-05-31 14:00:58 +00:00
|
|
|
ATTR_STATE_CLASS: STATE_CLASS_MEASUREMENT,
|
2021-05-07 14:47:52 +00:00
|
|
|
},
|
|
|
|
ATTR_API_TEMPERATURE: {
|
2021-05-20 09:34:32 +00:00
|
|
|
ATTR_DEVICE_CLASS: DEVICE_CLASS_TEMPERATURE,
|
|
|
|
ATTR_ICON: None,
|
|
|
|
ATTR_LABEL: ATTR_API_TEMPERATURE.capitalize(),
|
|
|
|
ATTR_UNIT: TEMP_CELSIUS,
|
2021-05-31 14:00:58 +00:00
|
|
|
ATTR_STATE_CLASS: STATE_CLASS_MEASUREMENT,
|
2021-05-07 14:47:52 +00:00
|
|
|
},
|
|
|
|
}
|