Skip to content

Commit a1cf999

Browse files
dumpfheimerChristopher Hochchris-hoch-hpc
authored
Xiaomi H1 Wired Double Rocker Switch With Neutral (#1391)
* Working on Aqara D1 3 button wall switch * reformated some stuff, added workaround for possibly compatibility issue * reformat * reformat * added Aqara H1 * generalized a bit * reformat * generalize * clean up * updated opple switch and added configuratione exposure * removed 'expose' attribute as it seems to have no future * trying "multi-class multi-face approach" * trying "multi-class multi-face approach": fixes * trying "multi-class multi-face approach": fixing isort * trying "multi-class multi-face approach": fixing flake8 * trying "multi-class multi-face approach": fixing black * trying "multi-class multi-face approach": fixing isort * trying "multi-class multi-face approach": fixing tests (which I do not understand) * trying "multi-class multi-face approach": fixing black * trying "multi-class multi-face approach": fixing tests (which I do not understand) * trying "multi-class multi-face approach": fixing tests.. moved 3 button class and reused triggers * trying "multi-class multi-face approach": removed 3 button switch (for now) * trying "multi-class multi-face approach": fixing flake8 * added metering cluster (suddenly worked without any other changes after a few minutes) * testing xiaomi metering cluster * merged the two "hold" commands as they seem to be the same for both buttons - and they fail the tests * using smartenergy Metering * fix tests * switched from uint8_t to enum8 for configuration entitites * reverted "switched from uint8_t to enum8 for configuration entitites": datatype mismatch * fixed typing/enum issue for configuration entitites * fixed isort * feedback from devs * feedback from devs * feedback from devs Co-authored-by: Christopher Hoch <[email protected]> Co-authored-by: Christopher Hoch <[email protected]>
1 parent 956db90 commit a1cf999

File tree

2 files changed

+415
-0
lines changed

2 files changed

+415
-0
lines changed

zhaquirks/xiaomi/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
RelativeHumidity,
2626
TemperatureMeasurement,
2727
)
28+
from zigpy.zcl.clusters.smartenergy import Metering
2829
import zigpy.zcl.foundation as foundation
2930
import zigpy.zdo
3031
from zigpy.zdo.types import NodeDescriptor
@@ -461,6 +462,10 @@ class DeviceTemperatureCluster(LocalDataCluster, DeviceTemperature):
461462
"""Device Temperature Cluster."""
462463

463464

465+
class XiaomiMeteringCluster(LocalDataCluster, Metering):
466+
"""Xiaomi Metering Cluster."""
467+
468+
464469
class TemperatureMeasurementCluster(CustomCluster, TemperatureMeasurement):
465470
"""Temperature cluster that filters out invalid temperature readings."""
466471

0 commit comments

Comments
 (0)