Skip to content

Commit

Permalink
Change CustomCluster names
Browse files Browse the repository at this point in the history
  • Loading branch information
gigamonster256 committed Sep 17, 2024
1 parent 1c62de8 commit dedfbb3
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions zhaquirks/xiaomi/custom/z03mmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
from zigpy.profiles import zha
from zigpy.types import Bool, int16s, uint16_t
from zigpy.zcl.clusters.general import Basic, Identify, Ota, PowerConfiguration
from zigpy.zcl.clusters.hvac import UserInterface as UserInterfaceBase
from zigpy.zcl.clusters.measurement import (
RelativeHumidity as RelativeHumidityBase,
TemperatureMeasurement as TemperatureMeasurementBase,
)
from zigpy.zcl.clusters.hvac import UserInterface
from zigpy.zcl.clusters.measurement import RelativeHumidity, TemperatureMeasurement
from zigpy.zcl.foundation import ZCLAttributeDef

from zhaquirks import CustomCluster
Expand All @@ -22,10 +19,10 @@
from zhaquirks.xiaomi import XiaomiCustomDevice


class TemperatureMeasurement(CustomCluster, TemperatureMeasurementBase):
class TemperatureMeasurementCustom(CustomCluster, TemperatureMeasurement):
"""Temperature Measurement Cluster with calibration attribute."""

class AttributeDefs(TemperatureMeasurementBase.AttributeDefs):
class AttributeDefs(TemperatureMeasurement.AttributeDefs):
"""Attribute Definitions."""

# A value in 0.01ºC offset to fix up incorrect values from sensor
Expand All @@ -37,10 +34,10 @@ class AttributeDefs(TemperatureMeasurementBase.AttributeDefs):
)


class RelativeHumidity(CustomCluster, RelativeHumidityBase):
class RelativeHumidityCustom(CustomCluster, RelativeHumidity):
"""Relative Humidity Cluster with calibration attribute."""

class AttributeDefs(RelativeHumidityBase.AttributeDefs):
class AttributeDefs(RelativeHumidity.AttributeDefs):
"""Attribute Definitions."""

# A value in 0.01%RH offset to fix up incorrect values from sensor
Expand All @@ -52,10 +49,10 @@ class AttributeDefs(RelativeHumidityBase.AttributeDefs):
)


class UserInterface(CustomCluster, UserInterfaceBase):
class UserInterfaceCustom(CustomCluster, UserInterface):
"""Custom User Interface Cluster with smiley control."""

class AttributeDefs(UserInterfaceBase.AttributeDefs):
class AttributeDefs(UserInterface.AttributeDefs):
"""Attribute Definitions."""

# of the 3 ZCL Thermostat User Interface spec attributes,
Expand Down Expand Up @@ -129,9 +126,9 @@ class LYWSD03MMC_devbis(XiaomiCustomDevice):
Basic.cluster_id,
Identify.cluster_id,
PowerConfiguration.cluster_id,
RelativeHumidityBase.cluster_id,
TemperatureMeasurementBase.cluster_id,
UserInterfaceBase.cluster_id,
RelativeHumidity.cluster_id,
TemperatureMeasurement.cluster_id,
UserInterface.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
Expand All @@ -146,9 +143,9 @@ class LYWSD03MMC_devbis(XiaomiCustomDevice):
Basic.cluster_id,
Identify.cluster_id,
PowerConfiguration.cluster_id,
RelativeHumidity,
TemperatureMeasurement,
UserInterface,
RelativeHumidityCustom,
TemperatureMeasurementCustom,
UserInterfaceCustom,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
Expand Down

0 comments on commit dedfbb3

Please sign in to comment.