Add precipitation device class (#4219)

This commit is contained in:
Jesse Hills 2022-12-22 21:18:58 +13:00 committed by GitHub
parent 57a1c207c2
commit 7e376ae952
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -41,6 +41,7 @@ from esphome.const import (
DEVICE_CLASS_PM25,
DEVICE_CLASS_POWER,
DEVICE_CLASS_POWER_FACTOR,
DEVICE_CLASS_PRECIPITATION,
DEVICE_CLASS_PRECIPITATION_INTENSITY,
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_REACTIVE_POWER,
@ -84,6 +85,7 @@ DEVICE_CLASSES = [
DEVICE_CLASS_PM25,
DEVICE_CLASS_POWER_FACTOR,
DEVICE_CLASS_POWER,
DEVICE_CLASS_PRECIPITATION,
DEVICE_CLASS_PRECIPITATION_INTENSITY,
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_REACTIVE_POWER,

View File

@ -55,6 +55,7 @@ from esphome.const import (
DEVICE_CLASS_PM25,
DEVICE_CLASS_POWER,
DEVICE_CLASS_POWER_FACTOR,
DEVICE_CLASS_PRECIPITATION,
DEVICE_CLASS_PRECIPITATION_INTENSITY,
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_REACTIVE_POWER,
@ -103,6 +104,7 @@ DEVICE_CLASSES = [
DEVICE_CLASS_PM25,
DEVICE_CLASS_POWER,
DEVICE_CLASS_POWER_FACTOR,
DEVICE_CLASS_PRECIPITATION,
DEVICE_CLASS_PRECIPITATION_INTENSITY,
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_REACTIVE_POWER,
@ -115,8 +117,8 @@ DEVICE_CLASSES = [
DEVICE_CLASS_VOLTAGE,
DEVICE_CLASS_VOLUME,
DEVICE_CLASS_WATER,
DEVICE_CLASS_WIND_SPEED,
DEVICE_CLASS_WEIGHT,
DEVICE_CLASS_WIND_SPEED,
]
sensor_ns = cg.esphome_ns.namespace("sensor")

View File

@ -954,6 +954,7 @@ DEVICE_CLASS_PM1 = "pm1"
DEVICE_CLASS_PM10 = "pm10"
DEVICE_CLASS_PM25 = "pm25"
DEVICE_CLASS_POWER_FACTOR = "power_factor"
DEVICE_CLASS_PRECIPITATION = "precipitation"
DEVICE_CLASS_PRECIPITATION_INTENSITY = "precipitation_intensity"
DEVICE_CLASS_PRESSURE = "pressure"
DEVICE_CLASS_REACTIVE_POWER = "reactive_power"