Use new DeviceClass, StateClass and EntityCategory enums in ambient_station (#61266)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-08 21:06:31 +01:00 committed by GitHub
parent c71fe71654
commit 8a11cf3d1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 153 additions and 160 deletions

View File

@ -5,14 +5,14 @@ from dataclasses import dataclass
from typing import Literal from typing import Literal
from homeassistant.components.binary_sensor import ( from homeassistant.components.binary_sensor import (
DEVICE_CLASS_BATTERY, BinarySensorDeviceClass,
DEVICE_CLASS_CONNECTIVITY,
BinarySensorEntity, BinarySensorEntity,
BinarySensorEntityDescription, BinarySensorEntityDescription,
) )
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_NAME, ENTITY_CATEGORY_DIAGNOSTIC from homeassistant.const import ATTR_NAME
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AmbientWeatherEntity from . import AmbientWeatherEntity
@ -62,169 +62,169 @@ BINARY_SENSOR_DESCRIPTIONS = (
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATTOUT, key=TYPE_BATTOUT,
name="Battery", name="Battery",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATT1, key=TYPE_BATT1,
name="Battery 1", name="Battery 1",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATT2, key=TYPE_BATT2,
name="Battery 2", name="Battery 2",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATT3, key=TYPE_BATT3,
name="Battery 3", name="Battery 3",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATT4, key=TYPE_BATT4,
name="Battery 4", name="Battery 4",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATT5, key=TYPE_BATT5,
name="Battery 5", name="Battery 5",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATT6, key=TYPE_BATT6,
name="Battery 6", name="Battery 6",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATT7, key=TYPE_BATT7,
name="Battery 7", name="Battery 7",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATT8, key=TYPE_BATT8,
name="Battery 8", name="Battery 8",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATT9, key=TYPE_BATT9,
name="Battery 9", name="Battery 9",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATT10, key=TYPE_BATT10,
name="Battery 10", name="Battery 10",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_BATT_CO2, key=TYPE_BATT_CO2,
name="CO2 Battery", name="CO2 Battery",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_PM25IN_BATT, key=TYPE_PM25IN_BATT,
name="PM25 Indoor Battery", name="PM25 Indoor Battery",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_PM25_BATT, key=TYPE_PM25_BATT,
name="PM25 Battery", name="PM25 Battery",
device_class=DEVICE_CLASS_BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=0, on_state=0,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_RELAY1, key=TYPE_RELAY1,
name="Relay 1", name="Relay 1",
device_class=DEVICE_CLASS_CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=1, on_state=1,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_RELAY2, key=TYPE_RELAY2,
name="Relay 2", name="Relay 2",
device_class=DEVICE_CLASS_CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=1, on_state=1,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_RELAY3, key=TYPE_RELAY3,
name="Relay 3", name="Relay 3",
device_class=DEVICE_CLASS_CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=1, on_state=1,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_RELAY4, key=TYPE_RELAY4,
name="Relay 4", name="Relay 4",
device_class=DEVICE_CLASS_CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=1, on_state=1,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_RELAY5, key=TYPE_RELAY5,
name="Relay 5", name="Relay 5",
device_class=DEVICE_CLASS_CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=1, on_state=1,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_RELAY6, key=TYPE_RELAY6,
name="Relay 6", name="Relay 6",
device_class=DEVICE_CLASS_CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=1, on_state=1,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_RELAY7, key=TYPE_RELAY7,
name="Relay 7", name="Relay 7",
device_class=DEVICE_CLASS_CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=1, on_state=1,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_RELAY8, key=TYPE_RELAY8,
name="Relay 8", name="Relay 8",
device_class=DEVICE_CLASS_CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=1, on_state=1,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_RELAY9, key=TYPE_RELAY9,
name="Relay 9", name="Relay 9",
device_class=DEVICE_CLASS_CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=1, on_state=1,
), ),
AmbientBinarySensorDescription( AmbientBinarySensorDescription(
key=TYPE_RELAY10, key=TYPE_RELAY10,
name="Relay 10", name="Relay 10",
device_class=DEVICE_CLASS_CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
on_state=1, on_state=1,
), ),
) )

View File

@ -4,10 +4,10 @@ from __future__ import annotations
from datetime import datetime from datetime import datetime
from homeassistant.components.sensor import ( from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT, SensorDeviceClass,
STATE_CLASS_TOTAL_INCREASING,
SensorEntity, SensorEntity,
SensorEntityDescription, SensorEntityDescription,
SensorStateClass,
) )
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ( from homeassistant.const import (
@ -15,13 +15,6 @@ from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_MILLION, CONCENTRATION_PARTS_PER_MILLION,
DEGREE, DEGREE,
DEVICE_CLASS_CO2,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_PM25,
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_TIMESTAMP,
IRRADIATION_WATTS_PER_SQUARE_METER, IRRADIATION_WATTS_PER_SQUARE_METER,
LIGHT_LUX, LIGHT_LUX,
PERCENTAGE, PERCENTAGE,
@ -122,430 +115,430 @@ SENSOR_DESCRIPTIONS = (
name="24 Hr Rain", name="24 Hr Rain",
icon="mdi:water", icon="mdi:water",
native_unit_of_measurement=PRECIPITATION_INCHES, native_unit_of_measurement=PRECIPITATION_INCHES,
state_class=STATE_CLASS_TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_BAROMABSIN, key=TYPE_BAROMABSIN,
name="Abs Pressure", name="Abs Pressure",
native_unit_of_measurement=PRESSURE_INHG, native_unit_of_measurement=PRESSURE_INHG,
device_class=DEVICE_CLASS_PRESSURE, device_class=SensorDeviceClass.PRESSURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_BAROMRELIN, key=TYPE_BAROMRELIN,
name="Rel Pressure", name="Rel Pressure",
native_unit_of_measurement=PRESSURE_INHG, native_unit_of_measurement=PRESSURE_INHG,
device_class=DEVICE_CLASS_PRESSURE, device_class=SensorDeviceClass.PRESSURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_CO2, key=TYPE_CO2,
name="co2", name="co2",
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
device_class=DEVICE_CLASS_CO2, device_class=SensorDeviceClass.CO2,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_DAILYRAININ, key=TYPE_DAILYRAININ,
name="Daily Rain", name="Daily Rain",
icon="mdi:water", icon="mdi:water",
native_unit_of_measurement=PRECIPITATION_INCHES, native_unit_of_measurement=PRECIPITATION_INCHES,
state_class=STATE_CLASS_TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_DEWPOINT, key=TYPE_DEWPOINT,
name="Dew Point", name="Dew Point",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_EVENTRAININ, key=TYPE_EVENTRAININ,
name="Event Rain", name="Event Rain",
icon="mdi:water", icon="mdi:water",
native_unit_of_measurement=PRECIPITATION_INCHES, native_unit_of_measurement=PRECIPITATION_INCHES,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_FEELSLIKE, key=TYPE_FEELSLIKE,
name="Feels Like", name="Feels Like",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HOURLYRAININ, key=TYPE_HOURLYRAININ,
name="Hourly Rain Rate", name="Hourly Rain Rate",
icon="mdi:water", icon="mdi:water",
native_unit_of_measurement=PRECIPITATION_INCHES_PER_HOUR, native_unit_of_measurement=PRECIPITATION_INCHES_PER_HOUR,
state_class=STATE_CLASS_TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITY10, key=TYPE_HUMIDITY10,
name="Humidity 10", name="Humidity 10",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITY1, key=TYPE_HUMIDITY1,
name="Humidity 1", name="Humidity 1",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITY2, key=TYPE_HUMIDITY2,
name="Humidity 2", name="Humidity 2",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITY3, key=TYPE_HUMIDITY3,
name="Humidity 3", name="Humidity 3",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITY4, key=TYPE_HUMIDITY4,
name="Humidity 4", name="Humidity 4",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITY5, key=TYPE_HUMIDITY5,
name="Humidity 5", name="Humidity 5",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITY6, key=TYPE_HUMIDITY6,
name="Humidity 6", name="Humidity 6",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITY7, key=TYPE_HUMIDITY7,
name="Humidity 7", name="Humidity 7",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITY8, key=TYPE_HUMIDITY8,
name="Humidity 8", name="Humidity 8",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITY9, key=TYPE_HUMIDITY9,
name="Humidity 9", name="Humidity 9",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITY, key=TYPE_HUMIDITY,
name="Humidity", name="Humidity",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_HUMIDITYIN, key=TYPE_HUMIDITYIN,
name="Humidity In", name="Humidity In",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_LASTRAIN, key=TYPE_LASTRAIN,
name="Last Rain", name="Last Rain",
icon="mdi:water", icon="mdi:water",
device_class=DEVICE_CLASS_TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_MAXDAILYGUST, key=TYPE_MAXDAILYGUST,
name="Max Gust", name="Max Gust",
icon="mdi:weather-windy", icon="mdi:weather-windy",
native_unit_of_measurement=SPEED_MILES_PER_HOUR, native_unit_of_measurement=SPEED_MILES_PER_HOUR,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_MONTHLYRAININ, key=TYPE_MONTHLYRAININ,
name="Monthly Rain", name="Monthly Rain",
icon="mdi:water", icon="mdi:water",
native_unit_of_measurement=PRECIPITATION_INCHES, native_unit_of_measurement=PRECIPITATION_INCHES,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_PM25_24H, key=TYPE_PM25_24H,
name="PM25 24h Avg", name="PM25 24h Avg",
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
device_class=DEVICE_CLASS_PM25, device_class=SensorDeviceClass.PM25,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_PM25_IN, key=TYPE_PM25_IN,
name="PM25 Indoor", name="PM25 Indoor",
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
device_class=DEVICE_CLASS_PM25, device_class=SensorDeviceClass.PM25,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_PM25_IN_24H, key=TYPE_PM25_IN_24H,
name="PM25 Indoor 24h Avg", name="PM25 Indoor 24h Avg",
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
device_class=DEVICE_CLASS_PM25, device_class=SensorDeviceClass.PM25,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_PM25, key=TYPE_PM25,
name="PM25", name="PM25",
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
device_class=DEVICE_CLASS_PM25, device_class=SensorDeviceClass.PM25,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILHUM10, key=TYPE_SOILHUM10,
name="Soil Humidity 10", name="Soil Humidity 10",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILHUM1, key=TYPE_SOILHUM1,
name="Soil Humidity 1", name="Soil Humidity 1",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILHUM2, key=TYPE_SOILHUM2,
name="Soil Humidity 2", name="Soil Humidity 2",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILHUM3, key=TYPE_SOILHUM3,
name="Soil Humidity 3", name="Soil Humidity 3",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILHUM4, key=TYPE_SOILHUM4,
name="Soil Humidity 4", name="Soil Humidity 4",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILHUM5, key=TYPE_SOILHUM5,
name="Soil Humidity 5", name="Soil Humidity 5",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILHUM6, key=TYPE_SOILHUM6,
name="Soil Humidity 6", name="Soil Humidity 6",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILHUM7, key=TYPE_SOILHUM7,
name="Soil Humidity 7", name="Soil Humidity 7",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILHUM8, key=TYPE_SOILHUM8,
name="Soil Humidity 8", name="Soil Humidity 8",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILHUM9, key=TYPE_SOILHUM9,
name="Soil Humidity 9", name="Soil Humidity 9",
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILTEMP10F, key=TYPE_SOILTEMP10F,
name="Soil Temp 10", name="Soil Temp 10",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILTEMP1F, key=TYPE_SOILTEMP1F,
name="Soil Temp 1", name="Soil Temp 1",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILTEMP2F, key=TYPE_SOILTEMP2F,
name="Soil Temp 2", name="Soil Temp 2",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILTEMP3F, key=TYPE_SOILTEMP3F,
name="Soil Temp 3", name="Soil Temp 3",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILTEMP4F, key=TYPE_SOILTEMP4F,
name="Soil Temp 4", name="Soil Temp 4",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILTEMP5F, key=TYPE_SOILTEMP5F,
name="Soil Temp 5", name="Soil Temp 5",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILTEMP6F, key=TYPE_SOILTEMP6F,
name="Soil Temp 6", name="Soil Temp 6",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILTEMP7F, key=TYPE_SOILTEMP7F,
name="Soil Temp 7", name="Soil Temp 7",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILTEMP8F, key=TYPE_SOILTEMP8F,
name="Soil Temp 8", name="Soil Temp 8",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOILTEMP9F, key=TYPE_SOILTEMP9F,
name="Soil Temp 9", name="Soil Temp 9",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOLARRADIATION, key=TYPE_SOLARRADIATION,
name="Solar Rad", name="Solar Rad",
native_unit_of_measurement=IRRADIATION_WATTS_PER_SQUARE_METER, native_unit_of_measurement=IRRADIATION_WATTS_PER_SQUARE_METER,
device_class=DEVICE_CLASS_ILLUMINANCE, device_class=SensorDeviceClass.ILLUMINANCE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_SOLARRADIATION_LX, key=TYPE_SOLARRADIATION_LX,
name="Solar Rad", name="Solar Rad",
native_unit_of_measurement=LIGHT_LUX, native_unit_of_measurement=LIGHT_LUX,
device_class=DEVICE_CLASS_ILLUMINANCE, device_class=SensorDeviceClass.ILLUMINANCE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMP10F, key=TYPE_TEMP10F,
name="Temp 10", name="Temp 10",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMP1F, key=TYPE_TEMP1F,
name="Temp 1", name="Temp 1",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMP2F, key=TYPE_TEMP2F,
name="Temp 2", name="Temp 2",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMP3F, key=TYPE_TEMP3F,
name="Temp 3", name="Temp 3",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMP4F, key=TYPE_TEMP4F,
name="Temp 4", name="Temp 4",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMP5F, key=TYPE_TEMP5F,
name="Temp 5", name="Temp 5",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMP6F, key=TYPE_TEMP6F,
name="Temp 6", name="Temp 6",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMP7F, key=TYPE_TEMP7F,
name="Temp 7", name="Temp 7",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMP8F, key=TYPE_TEMP8F,
name="Temp 8", name="Temp 8",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMP9F, key=TYPE_TEMP9F,
name="Temp 9", name="Temp 9",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMPF, key=TYPE_TEMPF,
name="Temp", name="Temp",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TEMPINF, key=TYPE_TEMPINF,
name="Inside Temp", name="Inside Temp",
native_unit_of_measurement=TEMP_FAHRENHEIT, native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_TOTALRAININ, key=TYPE_TOTALRAININ,
name="Lifetime Rain", name="Lifetime Rain",
icon="mdi:water", icon="mdi:water",
native_unit_of_measurement=PRECIPITATION_INCHES, native_unit_of_measurement=PRECIPITATION_INCHES,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_UV, key=TYPE_UV,
name="UV Index", name="UV Index",
native_unit_of_measurement="Index", native_unit_of_measurement="Index",
device_class=DEVICE_CLASS_ILLUMINANCE, device_class=SensorDeviceClass.ILLUMINANCE,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_WEEKLYRAININ, key=TYPE_WEEKLYRAININ,
name="Weekly Rain", name="Weekly Rain",
icon="mdi:water", icon="mdi:water",
native_unit_of_measurement=PRECIPITATION_INCHES, native_unit_of_measurement=PRECIPITATION_INCHES,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_WINDDIR, key=TYPE_WINDDIR,
@ -576,7 +569,7 @@ SENSOR_DESCRIPTIONS = (
name="Wind Gust", name="Wind Gust",
icon="mdi:weather-windy", icon="mdi:weather-windy",
native_unit_of_measurement=SPEED_MILES_PER_HOUR, native_unit_of_measurement=SPEED_MILES_PER_HOUR,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_WINDSPDMPH_AVG10M, key=TYPE_WINDSPDMPH_AVG10M,
@ -595,14 +588,14 @@ SENSOR_DESCRIPTIONS = (
name="Wind Speed", name="Wind Speed",
icon="mdi:weather-windy", icon="mdi:weather-windy",
native_unit_of_measurement=SPEED_MILES_PER_HOUR, native_unit_of_measurement=SPEED_MILES_PER_HOUR,
state_class=STATE_CLASS_MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(
key=TYPE_YEARLYRAININ, key=TYPE_YEARLYRAININ,
name="Yearly Rain", name="Yearly Rain",
icon="mdi:water", icon="mdi:water",
native_unit_of_measurement=PRECIPITATION_INCHES, native_unit_of_measurement=PRECIPITATION_INCHES,
state_class=STATE_CLASS_TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
), ),
) )