diff --git a/esphome/components/sensor/__init__.py b/esphome/components/sensor/__init__.py index 12daf34d6e..3ed27390bd 100644 --- a/esphome/components/sensor/__init__.py +++ b/esphome/components/sensor/__init__.py @@ -55,6 +55,7 @@ from esphome.const import ( DEVICE_CLASS_PM25, DEVICE_CLASS_POWER, DEVICE_CLASS_POWER_FACTOR, + DEVICE_CLASS_PRECIPITATION_INTENSITY, DEVICE_CLASS_PRESSURE, DEVICE_CLASS_REACTIVE_POWER, DEVICE_CLASS_SIGNAL_STRENGTH, @@ -65,6 +66,7 @@ from esphome.const import ( DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS, DEVICE_CLASS_VOLTAGE, DEVICE_CLASS_VOLUME, + DEVICE_CLASS_WATER, DEVICE_CLASS_WEIGHT, ) from esphome.core import CORE, coroutine_with_priority @@ -100,6 +102,7 @@ DEVICE_CLASSES = [ DEVICE_CLASS_PM25, DEVICE_CLASS_POWER, DEVICE_CLASS_POWER_FACTOR, + DEVICE_CLASS_PRECIPITATION_INTENSITY, DEVICE_CLASS_PRESSURE, DEVICE_CLASS_REACTIVE_POWER, DEVICE_CLASS_SIGNAL_STRENGTH, @@ -110,6 +113,7 @@ DEVICE_CLASSES = [ DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS, DEVICE_CLASS_VOLTAGE, DEVICE_CLASS_VOLUME, + DEVICE_CLASS_WATER, DEVICE_CLASS_WEIGHT, ] diff --git a/esphome/const.py b/esphome/const.py index d2bac8f9df..96dfc47dbc 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -947,6 +947,7 @@ DEVICE_CLASS_PM1 = "pm1" DEVICE_CLASS_PM10 = "pm10" DEVICE_CLASS_PM25 = "pm25" DEVICE_CLASS_POWER_FACTOR = "power_factor" +DEVICE_CLASS_PRECIPITATION_INTENSITY = "precipitation_intensity" DEVICE_CLASS_PRESSURE = "pressure" DEVICE_CLASS_REACTIVE_POWER = "reactive_power" DEVICE_CLASS_SIGNAL_STRENGTH = "signal_strength" @@ -957,6 +958,7 @@ DEVICE_CLASS_TIMESTAMP = "timestamp" DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS = "volatile_organic_compounds" DEVICE_CLASS_VOLTAGE = "voltage" DEVICE_CLASS_VOLUME = "volume" +DEVICE_CLASS_WATER = "water" DEVICE_CLASS_WEIGHT = "weight" # device classes of both binary_sensor and button component DEVICE_CLASS_UPDATE = "update"