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 ZLinky variant for firmware v14.0 #3448

Merged
merged 1 commit into from
Oct 23, 2024
Merged
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
22 changes: 20 additions & 2 deletions zhaquirks/lixee/zlinky.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Identify,
Ota,
PowerConfiguration,
Time,
)
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement, MeterIdentification
from zigpy.zcl.clusters.smartenergy import Metering
Expand All @@ -24,6 +25,7 @@
PROFILE_ID,
)
from zhaquirks.lixee import LIXEE, ZLINKY_MANUFACTURER_CLUSTER_ID
from zhaquirks.tuya import TuyaManufCluster


class ZLinkyTICManufacturerCluster(CustomCluster):
Expand Down Expand Up @@ -200,9 +202,25 @@ class ZLinkyTIC(CustomDevice):


class ZLinkyTICFWV12(ZLinkyTIC):
"""ZLinky_TIC from LiXee with firmware v12.0+."""
"""ZLinky_TIC from LiXee with firmware v12.0 & v13.0."""

signature = deepcopy(ZLinkyTIC.signature)

# Insert PowerConfiguration cluster in signature for devices with firmware v12.0+
# Insert PowerConfiguration cluster in signature for devices with firmware v12.0 & v13.0
signature[ENDPOINTS][1][INPUT_CLUSTERS].insert(1, PowerConfiguration.cluster_id)


class ZLinkyTICFWV14(ZLinkyTICFWV12):
"""ZLinky_TIC from LiXee with firmware v14.0+."""

signature = deepcopy(ZLinkyTICFWV12.signature)
replacement = deepcopy(ZLinkyTICFWV12.replacement)

# Insert Time configuration cluster in signature for devices with firmware v14.0+
signature[ENDPOINTS][1][INPUT_CLUSTERS].insert(1, Time.cluster_id)

# Insert Tuya cluster in signature for devices with firmware v14.0+
signature[ENDPOINTS][1][INPUT_CLUSTERS].insert(7, TuyaManufCluster.cluster_id)
signature[ENDPOINTS][1][OUTPUT_CLUSTERS].insert(1, TuyaManufCluster.cluster_id)

replacement[ENDPOINTS][1][INPUT_CLUSTERS].insert(1, Time.cluster_id)