Skip to content

Conversation

@SimonIT
Copy link
Contributor

@SimonIT SimonIT commented Dec 8, 2025

Proposed change

Adds a quirk to support HOBEIAN ZG-101ZL. Fixes #4413

Additional information

Device diagnostics

zha-01K4JWJ9DDNB1VAA06YSTX8NTT-HOBEIAN ZG-101ZL-9abbcf89b43dd44cc8d4c2eb4a75505f.json

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works
  • Device diagnostics data has been attached

@SimonIT
Copy link
Contributor Author

SimonIT commented Dec 8, 2025

Not sure how I can prevent the test to fail. I tried to make a quirk v2, but it doesn't work:

"""HOBEIAN ZG-101ZL button quirk."""

from zigpy.profiles import zha
from zigpy.quirks.v2 import QuirkBuilder

from zhaquirks.const import (
    BUTTON_1,
    COMMAND,
    DOUBLE_PRESS,
    ENDPOINT_ID,
    LONG_PRESS,
    SHORT_PRESS,
)

"""HOBEIAN ZG-101ZL button quirk for proper button event handling."""
(
    QuirkBuilder("HOBEIAN", "ZG-101ZL")
    .replaces_endpoint(1, device_type=zha.DeviceType.REMOTE_CONTROL)
    .device_automation_triggers(
        {
            (SHORT_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: SHORT_PRESS},
            (DOUBLE_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: DOUBLE_PRESS},
            (LONG_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: LONG_PRESS},
        }
    )
    .add_to_registry()
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Device Support Request] HOBEIAN ZG-101ZL

1 participant