mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Add new data size device class (#83376)
This commit is contained in:
parent
25feac1bc4
commit
25961d71ef
@ -93,6 +93,12 @@ class NumberDeviceClass(StrEnum):
|
|||||||
Unit of measurement: `A`
|
Unit of measurement: `A`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
DATA_SIZE = "data_size"
|
||||||
|
"""Data size.
|
||||||
|
|
||||||
|
Unit of measurement: UnitOfInformation
|
||||||
|
"""
|
||||||
|
|
||||||
DISTANCE = "distance"
|
DISTANCE = "distance"
|
||||||
"""Generic distance.
|
"""Generic distance.
|
||||||
|
|
||||||
|
@ -157,6 +157,12 @@ class SensorDeviceClass(StrEnum):
|
|||||||
Unit of measurement: `A`
|
Unit of measurement: `A`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
DATA_SIZE = "data_size"
|
||||||
|
"""Data size.
|
||||||
|
|
||||||
|
Unit of measurement: UnitOfInformation
|
||||||
|
"""
|
||||||
|
|
||||||
DISTANCE = "distance"
|
DISTANCE = "distance"
|
||||||
"""Generic distance.
|
"""Generic distance.
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ CONF_IS_BATTERY_LEVEL = "is_battery_level"
|
|||||||
CONF_IS_CO = "is_carbon_monoxide"
|
CONF_IS_CO = "is_carbon_monoxide"
|
||||||
CONF_IS_CO2 = "is_carbon_dioxide"
|
CONF_IS_CO2 = "is_carbon_dioxide"
|
||||||
CONF_IS_CURRENT = "is_current"
|
CONF_IS_CURRENT = "is_current"
|
||||||
|
CONF_IS_DATA_SIZE = "is_data_size"
|
||||||
CONF_IS_DISTANCE = "is_distance"
|
CONF_IS_DISTANCE = "is_distance"
|
||||||
CONF_IS_ENERGY = "is_energy"
|
CONF_IS_ENERGY = "is_energy"
|
||||||
CONF_IS_FREQUENCY = "is_frequency"
|
CONF_IS_FREQUENCY = "is_frequency"
|
||||||
@ -74,6 +75,7 @@ ENTITY_CONDITIONS = {
|
|||||||
SensorDeviceClass.CO: [{CONF_TYPE: CONF_IS_CO}],
|
SensorDeviceClass.CO: [{CONF_TYPE: CONF_IS_CO}],
|
||||||
SensorDeviceClass.CO2: [{CONF_TYPE: CONF_IS_CO2}],
|
SensorDeviceClass.CO2: [{CONF_TYPE: CONF_IS_CO2}],
|
||||||
SensorDeviceClass.CURRENT: [{CONF_TYPE: CONF_IS_CURRENT}],
|
SensorDeviceClass.CURRENT: [{CONF_TYPE: CONF_IS_CURRENT}],
|
||||||
|
SensorDeviceClass.DATA_SIZE: [{CONF_TYPE: CONF_IS_DATA_SIZE}],
|
||||||
SensorDeviceClass.DISTANCE: [{CONF_TYPE: CONF_IS_DISTANCE}],
|
SensorDeviceClass.DISTANCE: [{CONF_TYPE: CONF_IS_DISTANCE}],
|
||||||
SensorDeviceClass.ENERGY: [{CONF_TYPE: CONF_IS_ENERGY}],
|
SensorDeviceClass.ENERGY: [{CONF_TYPE: CONF_IS_ENERGY}],
|
||||||
SensorDeviceClass.FREQUENCY: [{CONF_TYPE: CONF_IS_FREQUENCY}],
|
SensorDeviceClass.FREQUENCY: [{CONF_TYPE: CONF_IS_FREQUENCY}],
|
||||||
@ -122,6 +124,7 @@ CONDITION_SCHEMA = vol.All(
|
|||||||
CONF_IS_CO,
|
CONF_IS_CO,
|
||||||
CONF_IS_CO2,
|
CONF_IS_CO2,
|
||||||
CONF_IS_CURRENT,
|
CONF_IS_CURRENT,
|
||||||
|
CONF_IS_DATA_SIZE,
|
||||||
CONF_IS_DISTANCE,
|
CONF_IS_DISTANCE,
|
||||||
CONF_IS_ENERGY,
|
CONF_IS_ENERGY,
|
||||||
CONF_IS_FREQUENCY,
|
CONF_IS_FREQUENCY,
|
||||||
|
@ -35,6 +35,7 @@ CONF_BATTERY_LEVEL = "battery_level"
|
|||||||
CONF_CO = "carbon_monoxide"
|
CONF_CO = "carbon_monoxide"
|
||||||
CONF_CO2 = "carbon_dioxide"
|
CONF_CO2 = "carbon_dioxide"
|
||||||
CONF_CURRENT = "current"
|
CONF_CURRENT = "current"
|
||||||
|
CONF_DATA_SIZE = "data_size"
|
||||||
CONF_DISTANCE = "distance"
|
CONF_DISTANCE = "distance"
|
||||||
CONF_ENERGY = "energy"
|
CONF_ENERGY = "energy"
|
||||||
CONF_FREQUENCY = "frequency"
|
CONF_FREQUENCY = "frequency"
|
||||||
@ -73,6 +74,7 @@ ENTITY_TRIGGERS = {
|
|||||||
SensorDeviceClass.CO: [{CONF_TYPE: CONF_CO}],
|
SensorDeviceClass.CO: [{CONF_TYPE: CONF_CO}],
|
||||||
SensorDeviceClass.CO2: [{CONF_TYPE: CONF_CO2}],
|
SensorDeviceClass.CO2: [{CONF_TYPE: CONF_CO2}],
|
||||||
SensorDeviceClass.CURRENT: [{CONF_TYPE: CONF_CURRENT}],
|
SensorDeviceClass.CURRENT: [{CONF_TYPE: CONF_CURRENT}],
|
||||||
|
SensorDeviceClass.DATA_SIZE: [{CONF_TYPE: CONF_DATA_SIZE}],
|
||||||
SensorDeviceClass.DISTANCE: [{CONF_TYPE: CONF_DISTANCE}],
|
SensorDeviceClass.DISTANCE: [{CONF_TYPE: CONF_DISTANCE}],
|
||||||
SensorDeviceClass.ENERGY: [{CONF_TYPE: CONF_ENERGY}],
|
SensorDeviceClass.ENERGY: [{CONF_TYPE: CONF_ENERGY}],
|
||||||
SensorDeviceClass.FREQUENCY: [{CONF_TYPE: CONF_FREQUENCY}],
|
SensorDeviceClass.FREQUENCY: [{CONF_TYPE: CONF_FREQUENCY}],
|
||||||
@ -122,6 +124,7 @@ TRIGGER_SCHEMA = vol.All(
|
|||||||
CONF_CO,
|
CONF_CO,
|
||||||
CONF_CO2,
|
CONF_CO2,
|
||||||
CONF_CURRENT,
|
CONF_CURRENT,
|
||||||
|
CONF_DATA_SIZE,
|
||||||
CONF_DISTANCE,
|
CONF_DISTANCE,
|
||||||
CONF_ENERGY,
|
CONF_ENERGY,
|
||||||
CONF_FREQUENCY,
|
CONF_FREQUENCY,
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
"is_carbon_monoxide": "Current {entity_name} carbon monoxide concentration level",
|
"is_carbon_monoxide": "Current {entity_name} carbon monoxide concentration level",
|
||||||
"is_carbon_dioxide": "Current {entity_name} carbon dioxide concentration level",
|
"is_carbon_dioxide": "Current {entity_name} carbon dioxide concentration level",
|
||||||
"is_current": "Current {entity_name} current",
|
"is_current": "Current {entity_name} current",
|
||||||
|
"is_data_size": "Current {entity_name} data size",
|
||||||
"is_distance": "Current {entity_name} distance",
|
"is_distance": "Current {entity_name} distance",
|
||||||
"is_energy": "Current {entity_name} energy",
|
"is_energy": "Current {entity_name} energy",
|
||||||
"is_frequency": "Current {entity_name} frequency",
|
"is_frequency": "Current {entity_name} frequency",
|
||||||
@ -42,6 +43,7 @@
|
|||||||
"carbon_monoxide": "{entity_name} carbon monoxide concentration changes",
|
"carbon_monoxide": "{entity_name} carbon monoxide concentration changes",
|
||||||
"carbon_dioxide": "{entity_name} carbon dioxide concentration changes",
|
"carbon_dioxide": "{entity_name} carbon dioxide concentration changes",
|
||||||
"current": "{entity_name} current changes",
|
"current": "{entity_name} current changes",
|
||||||
|
"data_size": "{entity_name} data size changes",
|
||||||
"distance": "{entity_name} distance changes",
|
"distance": "{entity_name} distance changes",
|
||||||
"energy": "{entity_name} energy changes",
|
"energy": "{entity_name} energy changes",
|
||||||
"frequency": "{entity_name} frequency changes",
|
"frequency": "{entity_name} frequency changes",
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
"is_carbon_dioxide": "Current {entity_name} carbon dioxide concentration level",
|
"is_carbon_dioxide": "Current {entity_name} carbon dioxide concentration level",
|
||||||
"is_carbon_monoxide": "Current {entity_name} carbon monoxide concentration level",
|
"is_carbon_monoxide": "Current {entity_name} carbon monoxide concentration level",
|
||||||
"is_current": "Current {entity_name} current",
|
"is_current": "Current {entity_name} current",
|
||||||
|
"is_data_size": "Current {entity_name} data size",
|
||||||
"is_distance": "Current {entity_name} distance",
|
"is_distance": "Current {entity_name} distance",
|
||||||
"is_energy": "Current {entity_name} energy",
|
"is_energy": "Current {entity_name} energy",
|
||||||
"is_frequency": "Current {entity_name} frequency",
|
"is_frequency": "Current {entity_name} frequency",
|
||||||
@ -41,6 +42,7 @@
|
|||||||
"carbon_dioxide": "{entity_name} carbon dioxide concentration changes",
|
"carbon_dioxide": "{entity_name} carbon dioxide concentration changes",
|
||||||
"carbon_monoxide": "{entity_name} carbon monoxide concentration changes",
|
"carbon_monoxide": "{entity_name} carbon monoxide concentration changes",
|
||||||
"current": "{entity_name} current changes",
|
"current": "{entity_name} current changes",
|
||||||
|
"data_size": "{entity_name} data size changes",
|
||||||
"distance": "{entity_name} distance changes",
|
"distance": "{entity_name} distance changes",
|
||||||
"energy": "{entity_name} energy changes",
|
"energy": "{entity_name} energy changes",
|
||||||
"frequency": "{entity_name} frequency changes",
|
"frequency": "{entity_name} frequency changes",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user