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

Fix _TZ3000_zl1kmjqx with empty model string #3264

Merged
merged 16 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
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
13 changes: 12 additions & 1 deletion tests/test_quirks.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,18 @@ def test_quirk_quickinit(quirk: zigpy.quirks.CustomDevice) -> None:
assert isinstance(ep_data[OUTPUT_CLUSTERS], list)


@pytest.mark.parametrize("quirk", ALL_QUIRK_CLASSES)
@pytest.mark.parametrize(
"quirk",
[
quirk_cls
for quirk_cls in ALL_QUIRK_CLASSES
if quirk_cls
not in (
# Some devices have empty model info:
zhaquirks.tuya.ty0201.TuyaTempHumiditySensorNoModel,
)
],
)
def test_signature(quirk: CustomDevice) -> None:
"""Make sure signature look sane for all custom devices."""

Expand Down
14 changes: 13 additions & 1 deletion zhaquirks/tuya/ty0201.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ class TuyaTempHumiditySensor(CustomDevice):
# <SimpleDescriptor endpoint=1, profile=260, device_type="0x0302"
# input_clusters=["0x000", "0x0001", "0x0003", "0x0402", "0x0405"]
# output_clusters=["0x0019"]>
MODELS_INFO: [("_TZ3000_bjawzodf", "TY0201"), ("_TZ3000_zl1kmjqx", "TY0201")],
MODELS_INFO: [
("_TZ3000_bjawzodf", "TY0201"),
("_TZ3000_zl1kmjqx", "TY0201"),
],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
Expand Down Expand Up @@ -59,3 +62,12 @@ class TuyaTempHumiditySensor(CustomDevice):
},
},
}


class TuyaTempHumiditySensorNoModel(TuyaTempHumiditySensor):
"""Temu/Aliexpress temperature and humidity sensor with empty model."""

signature = {
MODELS_INFO: [("_TZ3000_zl1kmjqx", "")],
ENDPOINTS: TuyaTempHumiditySensor.signature[ENDPOINTS],
}
Loading