Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new irradiance device class #83452

Merged
merged 3 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions homeassistant/components/number/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ class NumberDeviceClass(StrEnum):
Unit of measurement: `lx`, `lm`
"""

IRRADIANCE = "irradiance"
"""Irradiance.

Unit of measurement:
- SI / metric: `W/m²`
- USCS / imperial: `BTU/(h⋅ft²)`
"""

MOISTURE = "moisture"
"""Moisture.

Expand Down
8 changes: 8 additions & 0 deletions homeassistant/components/sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ class SensorDeviceClass(StrEnum):
Unit of measurement: `lx`, `lm`
"""

IRRADIANCE = "irradiance"
"""Irradiance.

Unit of measurement:
- SI / metric: `W/m²`
- USCS / imperial: `BTU/(h⋅ft²)`
"""

MOISTURE = "moisture"
"""Moisture.

Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/sensor/device_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
CONF_IS_HUMIDITY = "is_humidity"
CONF_IS_GAS = "is_gas"
CONF_IS_ILLUMINANCE = "is_illuminance"
CONF_IS_IRRADIANCE = "is_irradiance"
CONF_IS_MOISTURE = "is_moisture"
CONF_IS_NITROGEN_DIOXIDE = "is_nitrogen_dioxide"
CONF_IS_NITROGEN_MONOXIDE = "is_nitrogen_monoxide"
Expand Down Expand Up @@ -80,6 +81,7 @@
SensorDeviceClass.GAS: [{CONF_TYPE: CONF_IS_GAS}],
SensorDeviceClass.HUMIDITY: [{CONF_TYPE: CONF_IS_HUMIDITY}],
SensorDeviceClass.ILLUMINANCE: [{CONF_TYPE: CONF_IS_ILLUMINANCE}],
SensorDeviceClass.IRRADIANCE: [{CONF_TYPE: CONF_IS_IRRADIANCE}],
SensorDeviceClass.MOISTURE: [{CONF_TYPE: CONF_IS_MOISTURE}],
SensorDeviceClass.NITROGEN_DIOXIDE: [{CONF_TYPE: CONF_IS_NITROGEN_DIOXIDE}],
SensorDeviceClass.NITROGEN_MONOXIDE: [{CONF_TYPE: CONF_IS_NITROGEN_MONOXIDE}],
Expand Down Expand Up @@ -128,6 +130,7 @@
CONF_IS_GAS,
CONF_IS_HUMIDITY,
CONF_IS_ILLUMINANCE,
CONF_IS_IRRADIANCE,
CONF_IS_MOISTURE,
CONF_IS_NITROGEN_DIOXIDE,
CONF_IS_NITROGEN_MONOXIDE,
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/sensor/device_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
CONF_GAS = "gas"
CONF_HUMIDITY = "humidity"
CONF_ILLUMINANCE = "illuminance"
CONF_IRRADIANCE = "irradiance"
CONF_MOISTURE = "moisture"
CONF_NITROGEN_DIOXIDE = "nitrogen_dioxide"
CONF_NITROGEN_MONOXIDE = "nitrogen_monoxide"
Expand Down Expand Up @@ -79,6 +80,7 @@
SensorDeviceClass.GAS: [{CONF_TYPE: CONF_GAS}],
SensorDeviceClass.HUMIDITY: [{CONF_TYPE: CONF_HUMIDITY}],
SensorDeviceClass.ILLUMINANCE: [{CONF_TYPE: CONF_ILLUMINANCE}],
SensorDeviceClass.IRRADIANCE: [{CONF_TYPE: CONF_IRRADIANCE}],
SensorDeviceClass.MOISTURE: [{CONF_TYPE: CONF_MOISTURE}],
SensorDeviceClass.NITROGEN_DIOXIDE: [{CONF_TYPE: CONF_NITROGEN_DIOXIDE}],
SensorDeviceClass.NITROGEN_MONOXIDE: [{CONF_TYPE: CONF_NITROGEN_MONOXIDE}],
Expand Down Expand Up @@ -128,6 +130,7 @@
CONF_GAS,
CONF_HUMIDITY,
CONF_ILLUMINANCE,
CONF_IRRADIANCE,
CONF_MOISTURE,
CONF_NITROGEN_DIOXIDE,
CONF_NITROGEN_MONOXIDE,
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/sensor/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"is_gas": "Current {entity_name} gas",
"is_humidity": "Current {entity_name} humidity",
"is_illuminance": "Current {entity_name} illuminance",
"is_irradiance": "Current {entity_name} irradiance",
"is_moisture": "Current {entity_name} moisture",
"is_nitrogen_dioxide": "Current {entity_name} nitrogen dioxide concentration level",
"is_nitrogen_monoxide": "Current {entity_name} nitrogen monoxide concentration level",
Expand Down Expand Up @@ -48,6 +49,7 @@
"gas": "{entity_name} gas changes",
"humidity": "{entity_name} humidity changes",
"illuminance": "{entity_name} illuminance changes",
"irradiance": "{entity_name} irradiance changes",
"moisture": "{entity_name} moisture changes",
"nitrogen_dioxide": "{entity_name} nitrogen dioxide concentration changes",
"nitrogen_monoxide": "{entity_name} nitrogen monoxide concentration changes",
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/sensor/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"is_gas": "Current {entity_name} gas",
"is_humidity": "Current {entity_name} humidity",
"is_illuminance": "Current {entity_name} illuminance",
"is_irradiance": "Current {entity_name} irradiance",
"is_moisture": "Current {entity_name} moisture",
"is_nitrogen_dioxide": "Current {entity_name} nitrogen dioxide concentration level",
"is_nitrogen_monoxide": "Current {entity_name} nitrogen monoxide concentration level",
Expand Down Expand Up @@ -47,6 +48,7 @@
"gas": "{entity_name} gas changes",
"humidity": "{entity_name} humidity changes",
"illuminance": "{entity_name} illuminance changes",
"irradiance": "{entity_name} irradiance changes",
"moisture": "{entity_name} moisture changes",
"nitrogen_dioxide": "{entity_name} nitrogen dioxide concentration changes",
"nitrogen_monoxide": "{entity_name} nitrogen monoxide concentration changes",
Expand Down