mirror of https://github.com/home-assistant/core
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:
parent
2ba45a9f99
commit
321394d3e2
|
@ -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(
|
@registries.ZIGBEE_CHANNEL_REGISTRY.register(
|
||||||
measurement.FormaldehydeConcentration.cluster_id
|
measurement.FormaldehydeConcentration.cluster_id
|
||||||
)
|
)
|
||||||
|
|
|
@ -607,6 +607,17 @@ class PPBVOCLevel(Sensor):
|
||||||
_unit = CONCENTRATION_PARTS_PER_BILLION
|
_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")
|
@MULTI_MATCH(channel_names="formaldehyde_concentration")
|
||||||
class FormaldehydeConcentration(Sensor):
|
class FormaldehydeConcentration(Sensor):
|
||||||
"""Formaldehyde Concentration sensor."""
|
"""Formaldehyde Concentration sensor."""
|
||||||
|
|
Loading…
Reference in New Issue