Add precipitation_intensity sensor device class (#79779)
This commit is contained in:
parent
62b0735822
commit
05ef02bff6
3 changed files with 17 additions and 0 deletions
|
@ -241,6 +241,14 @@ class SensorDeviceClass(StrEnum):
|
|||
Unit of measurement: `W`, `kW`
|
||||
"""
|
||||
|
||||
PRECIPITATION_INTENSITY = "precipitation_intensity"
|
||||
"""Precipitation intensity.
|
||||
|
||||
Unit of measurement:
|
||||
- `in/d`, `in/h`
|
||||
- `mm/d`, `mm/h`
|
||||
"""
|
||||
|
||||
PRESSURE = "pressure"
|
||||
"""Pressure.
|
||||
|
||||
|
@ -361,6 +369,7 @@ STATE_CLASSES: Final[list[str]] = [cls.value for cls in SensorStateClass]
|
|||
|
||||
UNIT_CONVERTERS: dict[str, type[BaseUnitConverter]] = {
|
||||
SensorDeviceClass.DISTANCE: DistanceConverter,
|
||||
SensorDeviceClass.PRECIPITATION_INTENSITY: SpeedConverter,
|
||||
SensorDeviceClass.PRESSURE: PressureConverter,
|
||||
SensorDeviceClass.SPEED: SpeedConverter,
|
||||
SensorDeviceClass.TEMPERATURE: TemperatureConverter,
|
||||
|
|
|
@ -52,6 +52,7 @@ CONF_IS_PM10 = "is_pm10"
|
|||
CONF_IS_PM25 = "is_pm25"
|
||||
CONF_IS_POWER = "is_power"
|
||||
CONF_IS_POWER_FACTOR = "is_power_factor"
|
||||
CONF_IS_PRECIPITATION_INTENSITY = "is_precipitation_intensity"
|
||||
CONF_IS_PRESSURE = "is_pressure"
|
||||
CONF_IS_SPEED = "is_speed"
|
||||
CONF_IS_REACTIVE_POWER = "is_reactive_power"
|
||||
|
@ -86,6 +87,9 @@ ENTITY_CONDITIONS = {
|
|||
SensorDeviceClass.PM1: [{CONF_TYPE: CONF_IS_PM1}],
|
||||
SensorDeviceClass.PM10: [{CONF_TYPE: CONF_IS_PM10}],
|
||||
SensorDeviceClass.PM25: [{CONF_TYPE: CONF_IS_PM25}],
|
||||
SensorDeviceClass.PRECIPITATION_INTENSITY: [
|
||||
{CONF_TYPE: CONF_IS_PRECIPITATION_INTENSITY}
|
||||
],
|
||||
SensorDeviceClass.PRESSURE: [{CONF_TYPE: CONF_IS_PRESSURE}],
|
||||
SensorDeviceClass.REACTIVE_POWER: [{CONF_TYPE: CONF_IS_REACTIVE_POWER}],
|
||||
SensorDeviceClass.SIGNAL_STRENGTH: [{CONF_TYPE: CONF_IS_SIGNAL_STRENGTH}],
|
||||
|
|
|
@ -51,6 +51,7 @@ CONF_PM10 = "pm10"
|
|||
CONF_PM25 = "pm25"
|
||||
CONF_POWER = "power"
|
||||
CONF_POWER_FACTOR = "power_factor"
|
||||
CONF_PRECIPITATION_INTENSITY = "precipitation_intensity"
|
||||
CONF_PRESSURE = "pressure"
|
||||
CONF_REACTIVE_POWER = "reactive_power"
|
||||
CONF_SIGNAL_STRENGTH = "signal_strength"
|
||||
|
@ -85,6 +86,9 @@ ENTITY_TRIGGERS = {
|
|||
SensorDeviceClass.PM25: [{CONF_TYPE: CONF_PM25}],
|
||||
SensorDeviceClass.POWER: [{CONF_TYPE: CONF_POWER}],
|
||||
SensorDeviceClass.POWER_FACTOR: [{CONF_TYPE: CONF_POWER_FACTOR}],
|
||||
SensorDeviceClass.PRECIPITATION_INTENSITY: [
|
||||
{CONF_TYPE: CONF_PRECIPITATION_INTENSITY}
|
||||
],
|
||||
SensorDeviceClass.PRESSURE: [{CONF_TYPE: CONF_PRESSURE}],
|
||||
SensorDeviceClass.REACTIVE_POWER: [{CONF_TYPE: CONF_REACTIVE_POWER}],
|
||||
SensorDeviceClass.SIGNAL_STRENGTH: [{CONF_TYPE: CONF_SIGNAL_STRENGTH}],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue