Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions tests/test_tuya.py
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,7 @@ async def async_success(*args, **kwargs):
(zhaquirks.tuya.ts0041.TuyaSmartRemote0041TI, "_TZ3000_awgcnkrh"),
(zhaquirks.tuya.ts0041.TuyaSmartRemote0041TI, "_TZ3400_deyjhapk"),
(zhaquirks.tuya.ts0041.TuyaSmartRemote0041TI, "_some_random_manuf"),
(zhaquirks.tuya.ts0041.TuyaSmartRemote0041TIIAS, "_TZ3000_ajsypttg"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, optional: the sibling TuyaSmartRemote0041TI / ...TO rows each also carry a _some_random_manuf case, which is what this test is actually named for — these signatures key on MODEL alone, with no manufacturer. Adding one for the new class would assert that catch-all behaviour holds for it too. The real-manufacturer row you added is the more valuable of the two, so this is purely additive.

(zhaquirks.tuya.ts0041.TuyaSmartRemote0041TO, "_TZ3000_pwgcnkrh"),
(zhaquirks.tuya.ts0041.TuyaSmartRemote0041TO, "_TZ3400_leyjhapk"),
(zhaquirks.tuya.ts0041.TuyaSmartRemote0041TO, "_some_random_manuf"),
Expand Down
44 changes: 44 additions & 0 deletions zhaquirks/tuya/ts0041.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,50 @@ class TuyaSmartRemote0041TI(CustomDevice):
}


class TuyaSmartRemote0041TIIAS(CustomDevice):
"""Tuya 1-button remote device with time on in and IAS ancillary device type."""

signature = {
# SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=1025, device_version=1, input_clusters=[0, 1, 6, 10], output_clusters=[25]))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the pasted descriptor lists the input clusters as [0, 1, 6, 10], but the device reports them in the order [0, 10, 1, 6] (per original_signature in the diagnostics you attached). Cluster order has no effect on matching, so this is purely cosmetic — but these comments are meant to be the verbatim simple descriptor, so it would be nice for it to match. (The stray trailing ) is inherited from the class above; same category.)

# Tesla Smart TSL-SEN-BUTTON (_TZ3000_ajsypttg)
MODEL: "TS0041",
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.IAS_ANCILLARY_CONTROL,
INPUT_CLUSTERS: [
Basic.cluster_id,
PowerConfiguration.cluster_id,
OnOff.cluster_id,
Time.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
},
}
replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL,
INPUT_CLUSTERS: [
Basic.cluster_id,
TuyaNoBindPowerConfigurationCluster,
TuyaSmartRemoteOnOffCluster,
Time.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
},
}

device_automation_triggers = {
(SHORT_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: SHORT_PRESS},
(LONG_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: LONG_PRESS},
(DOUBLE_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: DOUBLE_PRESS},
}


class TuyaSmartRemote0041TOPlusA(CustomDevice):
"""Tuya 1-button remote device with time on out cluster."""

Expand Down
Loading