Add new WATER device class (#80886)
This commit is contained in:
parent
27a61f5407
commit
613ea28b0e
5 changed files with 19 additions and 2 deletions
|
@ -318,11 +318,19 @@ class SensorDeviceClass(StrEnum):
|
|||
|
||||
Unit of measurement: `VOLUME_*` units
|
||||
- SI / metric: `mL`, `L`, `m³`
|
||||
- USCS / imperial: `fl. oz.`, `gal`, `ft³` (warning: volumes expressed in
|
||||
- USCS / imperial: `fl. oz.`, `ft³`, `gal` (warning: volumes expressed in
|
||||
USCS/imperial units are currently assumed to be US volumes)
|
||||
"""
|
||||
|
||||
WATER = "water"
|
||||
"""Water.
|
||||
|
||||
Unit of measurement:
|
||||
- SI / metric: `m³`, `L`
|
||||
- USCS / imperial: `ft³`, `gal` (warning: volumes expressed in
|
||||
USCS/imperial units are currently assumed to be US volumes)
|
||||
"""
|
||||
|
||||
# weight/mass (g, kg, mg, µg, oz, lb)
|
||||
WEIGHT = "weight"
|
||||
"""Generic weight, represents a measurement of an object's mass.
|
||||
|
||||
|
@ -375,6 +383,7 @@ UNIT_CONVERTERS: dict[str, type[BaseUnitConverter]] = {
|
|||
SensorDeviceClass.SPEED: SpeedConverter,
|
||||
SensorDeviceClass.TEMPERATURE: TemperatureConverter,
|
||||
SensorDeviceClass.VOLUME: VolumeConverter,
|
||||
SensorDeviceClass.WATER: VolumeConverter,
|
||||
SensorDeviceClass.WEIGHT: MassConverter,
|
||||
}
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ CONF_IS_VALUE = "is_value"
|
|||
CONF_IS_VOLATILE_ORGANIC_COMPOUNDS = "is_volatile_organic_compounds"
|
||||
CONF_IS_VOLTAGE = "is_voltage"
|
||||
CONF_IS_VOLUME = "is_volume"
|
||||
CONF_IS_WATER = "is_water"
|
||||
CONF_IS_WEIGHT = "is_weight"
|
||||
|
||||
ENTITY_CONDITIONS = {
|
||||
|
@ -101,6 +102,7 @@ ENTITY_CONDITIONS = {
|
|||
],
|
||||
SensorDeviceClass.VOLTAGE: [{CONF_TYPE: CONF_IS_VOLTAGE}],
|
||||
SensorDeviceClass.VOLUME: [{CONF_TYPE: CONF_IS_VOLUME}],
|
||||
SensorDeviceClass.WATER: [{CONF_TYPE: CONF_IS_WATER}],
|
||||
SensorDeviceClass.WEIGHT: [{CONF_TYPE: CONF_IS_WEIGHT}],
|
||||
DEVICE_CLASS_NONE: [{CONF_TYPE: CONF_IS_VALUE}],
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ CONF_VALUE = "value"
|
|||
CONF_VOLATILE_ORGANIC_COMPOUNDS = "volatile_organic_compounds"
|
||||
CONF_VOLTAGE = "voltage"
|
||||
CONF_VOLUME = "volume"
|
||||
CONF_WATER = "water"
|
||||
CONF_WEIGHT = "weight"
|
||||
|
||||
ENTITY_TRIGGERS = {
|
||||
|
@ -100,6 +101,7 @@ ENTITY_TRIGGERS = {
|
|||
],
|
||||
SensorDeviceClass.VOLTAGE: [{CONF_TYPE: CONF_VOLTAGE}],
|
||||
SensorDeviceClass.VOLUME: [{CONF_TYPE: CONF_VOLUME}],
|
||||
SensorDeviceClass.WATER: [{CONF_TYPE: CONF_WATER}],
|
||||
SensorDeviceClass.WEIGHT: [{CONF_TYPE: CONF_WEIGHT}],
|
||||
DEVICE_CLASS_NONE: [{CONF_TYPE: CONF_VALUE}],
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
"is_volatile_organic_compounds": "Current {entity_name} volatile organic compounds concentration level",
|
||||
"is_voltage": "Current {entity_name} voltage",
|
||||
"is_volume": "Current {entity_name} volume",
|
||||
"is_water": "Current {entity_name} water",
|
||||
"is_weight": "Current {entity_name} weight"
|
||||
},
|
||||
"trigger_type": {
|
||||
|
@ -67,6 +68,7 @@
|
|||
"volatile_organic_compounds": "{entity_name} volatile organic compounds concentration changes",
|
||||
"voltage": "{entity_name} voltage changes",
|
||||
"volume": "{entity_name} volume changes",
|
||||
"water": "{entity_name} water changes",
|
||||
"weight": "{entity_name} weight changes"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
"is_volatile_organic_compounds": "Current {entity_name} volatile organic compounds concentration level",
|
||||
"is_voltage": "Current {entity_name} voltage",
|
||||
"is_volume": "Current {entity_name} volume",
|
||||
"is_water": "Current {entity_name} water",
|
||||
"is_weight": "Current {entity_name} weight"
|
||||
},
|
||||
"trigger_type": {
|
||||
|
@ -66,6 +67,7 @@
|
|||
"volatile_organic_compounds": "{entity_name} volatile organic compounds concentration changes",
|
||||
"voltage": "{entity_name} voltage changes",
|
||||
"volume": "{entity_name} volume changes",
|
||||
"water": "{entity_name} water changes",
|
||||
"weight": "{entity_name} weight changes"
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue