Add new irradiance device class (#83452)

This commit is contained in:
epenet 2022-12-08 18:44:23 +01:00 committed by GitHub
parent 90438edc17
commit c4326ed1ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 0 deletions

View File

@ -143,6 +143,14 @@ class NumberDeviceClass(StrEnum):
Unit of measurement: `lx`, `lm` Unit of measurement: `lx`, `lm`
""" """
IRRADIANCE = "irradiance"
"""Irradiance.
Unit of measurement:
- SI / metric: `W/`
- USCS / imperial: `BTU/(hft²)`
"""
MOISTURE = "moisture" MOISTURE = "moisture"
"""Moisture. """Moisture.

View File

@ -207,6 +207,14 @@ class SensorDeviceClass(StrEnum):
Unit of measurement: `lx`, `lm` Unit of measurement: `lx`, `lm`
""" """
IRRADIANCE = "irradiance"
"""Irradiance.
Unit of measurement:
- SI / metric: `W/`
- USCS / imperial: `BTU/(hft²)`
"""
MOISTURE = "moisture" MOISTURE = "moisture"
"""Moisture. """Moisture.

View File

@ -44,6 +44,7 @@ CONF_IS_FREQUENCY = "is_frequency"
CONF_IS_HUMIDITY = "is_humidity" CONF_IS_HUMIDITY = "is_humidity"
CONF_IS_GAS = "is_gas" CONF_IS_GAS = "is_gas"
CONF_IS_ILLUMINANCE = "is_illuminance" CONF_IS_ILLUMINANCE = "is_illuminance"
CONF_IS_IRRADIANCE = "is_irradiance"
CONF_IS_MOISTURE = "is_moisture" CONF_IS_MOISTURE = "is_moisture"
CONF_IS_NITROGEN_DIOXIDE = "is_nitrogen_dioxide" CONF_IS_NITROGEN_DIOXIDE = "is_nitrogen_dioxide"
CONF_IS_NITROGEN_MONOXIDE = "is_nitrogen_monoxide" CONF_IS_NITROGEN_MONOXIDE = "is_nitrogen_monoxide"
@ -84,6 +85,7 @@ ENTITY_CONDITIONS = {
SensorDeviceClass.GAS: [{CONF_TYPE: CONF_IS_GAS}], SensorDeviceClass.GAS: [{CONF_TYPE: CONF_IS_GAS}],
SensorDeviceClass.HUMIDITY: [{CONF_TYPE: CONF_IS_HUMIDITY}], SensorDeviceClass.HUMIDITY: [{CONF_TYPE: CONF_IS_HUMIDITY}],
SensorDeviceClass.ILLUMINANCE: [{CONF_TYPE: CONF_IS_ILLUMINANCE}], SensorDeviceClass.ILLUMINANCE: [{CONF_TYPE: CONF_IS_ILLUMINANCE}],
SensorDeviceClass.IRRADIANCE: [{CONF_TYPE: CONF_IS_IRRADIANCE}],
SensorDeviceClass.MOISTURE: [{CONF_TYPE: CONF_IS_MOISTURE}], SensorDeviceClass.MOISTURE: [{CONF_TYPE: CONF_IS_MOISTURE}],
SensorDeviceClass.NITROGEN_DIOXIDE: [{CONF_TYPE: CONF_IS_NITROGEN_DIOXIDE}], SensorDeviceClass.NITROGEN_DIOXIDE: [{CONF_TYPE: CONF_IS_NITROGEN_DIOXIDE}],
SensorDeviceClass.NITROGEN_MONOXIDE: [{CONF_TYPE: CONF_IS_NITROGEN_MONOXIDE}], SensorDeviceClass.NITROGEN_MONOXIDE: [{CONF_TYPE: CONF_IS_NITROGEN_MONOXIDE}],
@ -134,6 +136,7 @@ CONDITION_SCHEMA = vol.All(
CONF_IS_GAS, CONF_IS_GAS,
CONF_IS_HUMIDITY, CONF_IS_HUMIDITY,
CONF_IS_ILLUMINANCE, CONF_IS_ILLUMINANCE,
CONF_IS_IRRADIANCE,
CONF_IS_MOISTURE, CONF_IS_MOISTURE,
CONF_IS_NITROGEN_DIOXIDE, CONF_IS_NITROGEN_DIOXIDE,
CONF_IS_NITROGEN_MONOXIDE, CONF_IS_NITROGEN_MONOXIDE,

View File

@ -43,6 +43,7 @@ CONF_FREQUENCY = "frequency"
CONF_GAS = "gas" CONF_GAS = "gas"
CONF_HUMIDITY = "humidity" CONF_HUMIDITY = "humidity"
CONF_ILLUMINANCE = "illuminance" CONF_ILLUMINANCE = "illuminance"
CONF_IRRADIANCE = "irradiance"
CONF_MOISTURE = "moisture" CONF_MOISTURE = "moisture"
CONF_NITROGEN_DIOXIDE = "nitrogen_dioxide" CONF_NITROGEN_DIOXIDE = "nitrogen_dioxide"
CONF_NITROGEN_MONOXIDE = "nitrogen_monoxide" CONF_NITROGEN_MONOXIDE = "nitrogen_monoxide"
@ -83,6 +84,7 @@ ENTITY_TRIGGERS = {
SensorDeviceClass.GAS: [{CONF_TYPE: CONF_GAS}], SensorDeviceClass.GAS: [{CONF_TYPE: CONF_GAS}],
SensorDeviceClass.HUMIDITY: [{CONF_TYPE: CONF_HUMIDITY}], SensorDeviceClass.HUMIDITY: [{CONF_TYPE: CONF_HUMIDITY}],
SensorDeviceClass.ILLUMINANCE: [{CONF_TYPE: CONF_ILLUMINANCE}], SensorDeviceClass.ILLUMINANCE: [{CONF_TYPE: CONF_ILLUMINANCE}],
SensorDeviceClass.IRRADIANCE: [{CONF_TYPE: CONF_IRRADIANCE}],
SensorDeviceClass.MOISTURE: [{CONF_TYPE: CONF_MOISTURE}], SensorDeviceClass.MOISTURE: [{CONF_TYPE: CONF_MOISTURE}],
SensorDeviceClass.NITROGEN_DIOXIDE: [{CONF_TYPE: CONF_NITROGEN_DIOXIDE}], SensorDeviceClass.NITROGEN_DIOXIDE: [{CONF_TYPE: CONF_NITROGEN_DIOXIDE}],
SensorDeviceClass.NITROGEN_MONOXIDE: [{CONF_TYPE: CONF_NITROGEN_MONOXIDE}], SensorDeviceClass.NITROGEN_MONOXIDE: [{CONF_TYPE: CONF_NITROGEN_MONOXIDE}],
@ -134,6 +136,7 @@ TRIGGER_SCHEMA = vol.All(
CONF_GAS, CONF_GAS,
CONF_HUMIDITY, CONF_HUMIDITY,
CONF_ILLUMINANCE, CONF_ILLUMINANCE,
CONF_IRRADIANCE,
CONF_MOISTURE, CONF_MOISTURE,
CONF_NITROGEN_DIOXIDE, CONF_NITROGEN_DIOXIDE,
CONF_NITROGEN_MONOXIDE, CONF_NITROGEN_MONOXIDE,

View File

@ -15,6 +15,7 @@
"is_gas": "Current {entity_name} gas", "is_gas": "Current {entity_name} gas",
"is_humidity": "Current {entity_name} humidity", "is_humidity": "Current {entity_name} humidity",
"is_illuminance": "Current {entity_name} illuminance", "is_illuminance": "Current {entity_name} illuminance",
"is_irradiance": "Current {entity_name} irradiance",
"is_moisture": "Current {entity_name} moisture", "is_moisture": "Current {entity_name} moisture",
"is_nitrogen_dioxide": "Current {entity_name} nitrogen dioxide concentration level", "is_nitrogen_dioxide": "Current {entity_name} nitrogen dioxide concentration level",
"is_nitrogen_monoxide": "Current {entity_name} nitrogen monoxide concentration level", "is_nitrogen_monoxide": "Current {entity_name} nitrogen monoxide concentration level",
@ -51,6 +52,7 @@
"gas": "{entity_name} gas changes", "gas": "{entity_name} gas changes",
"humidity": "{entity_name} humidity changes", "humidity": "{entity_name} humidity changes",
"illuminance": "{entity_name} illuminance changes", "illuminance": "{entity_name} illuminance changes",
"irradiance": "{entity_name} irradiance changes",
"moisture": "{entity_name} moisture changes", "moisture": "{entity_name} moisture changes",
"nitrogen_dioxide": "{entity_name} nitrogen dioxide concentration changes", "nitrogen_dioxide": "{entity_name} nitrogen dioxide concentration changes",
"nitrogen_monoxide": "{entity_name} nitrogen monoxide concentration changes", "nitrogen_monoxide": "{entity_name} nitrogen monoxide concentration changes",

View File

@ -14,6 +14,7 @@
"is_gas": "Current {entity_name} gas", "is_gas": "Current {entity_name} gas",
"is_humidity": "Current {entity_name} humidity", "is_humidity": "Current {entity_name} humidity",
"is_illuminance": "Current {entity_name} illuminance", "is_illuminance": "Current {entity_name} illuminance",
"is_irradiance": "Current {entity_name} irradiance",
"is_moisture": "Current {entity_name} moisture", "is_moisture": "Current {entity_name} moisture",
"is_nitrogen_dioxide": "Current {entity_name} nitrogen dioxide concentration level", "is_nitrogen_dioxide": "Current {entity_name} nitrogen dioxide concentration level",
"is_nitrogen_monoxide": "Current {entity_name} nitrogen monoxide concentration level", "is_nitrogen_monoxide": "Current {entity_name} nitrogen monoxide concentration level",
@ -51,6 +52,7 @@
"gas": "{entity_name} gas changes", "gas": "{entity_name} gas changes",
"humidity": "{entity_name} humidity changes", "humidity": "{entity_name} humidity changes",
"illuminance": "{entity_name} illuminance changes", "illuminance": "{entity_name} illuminance changes",
"irradiance": "{entity_name} irradiance changes",
"moisture": "{entity_name} moisture changes", "moisture": "{entity_name} moisture changes",
"nitrogen_dioxide": "{entity_name} nitrogen dioxide concentration changes", "nitrogen_dioxide": "{entity_name} nitrogen dioxide concentration changes",
"nitrogen_monoxide": "{entity_name} nitrogen monoxide concentration changes", "nitrogen_monoxide": "{entity_name} nitrogen monoxide concentration changes",