Add Particulate Matter 2.5 of ZCL concentration clusters to ZHA component (#72826)

* Add Particulate Matter 2.5 of ZCL concentration clusters to ZHA component

* Fixed black and flake8 test
This commit is contained in:
Arne Mauer 2022-06-02 00:00:58 +02:00 committed by GitHub
parent 2ba45a9f99
commit 321394d3e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -128,6 +128,18 @@ class CarbonDioxideConcentration(ZigbeeChannel):
]
@registries.ZIGBEE_CHANNEL_REGISTRY.register(measurement.PM25.cluster_id)
class PM25(ZigbeeChannel):
"""Particulate Matter 2.5 microns or less measurement channel."""
REPORT_CONFIG = [
{
"attr": "measured_value",
"config": (REPORT_CONFIG_MIN_INT, REPORT_CONFIG_MAX_INT, 0.1),
}
]
@registries.ZIGBEE_CHANNEL_REGISTRY.register(
measurement.FormaldehydeConcentration.cluster_id
)

View File

@ -607,6 +607,17 @@ class PPBVOCLevel(Sensor):
_unit = CONCENTRATION_PARTS_PER_BILLION
@MULTI_MATCH(channel_names="pm25")
class PM25(Sensor):
"""Particulate Matter 2.5 microns or less sensor."""
SENSOR_ATTR = "measured_value"
_attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT
_decimals = 0
_multiplier = 1
_unit = CONCENTRATION_MICROGRAMS_PER_CUBIC_METER
@MULTI_MATCH(channel_names="formaldehyde_concentration")
class FormaldehydeConcentration(Sensor):
"""Formaldehyde Concentration sensor."""