Skip to content

Port Yale lock quirks to quirks v2 and add lock setting entities - #5262

Open
cydia2020 wants to merge 14 commits into
zigpy:devfrom
cydia2020:yale-refactor
Open

Port Yale lock quirks to quirks v2 and add lock setting entities#5262
cydia2020 wants to merge 14 commits into
zigpy:devfrom
cydia2020:yale-refactor

Conversation

@cydia2020

@cydia2020 cydia2020 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Proposed change

  • Moved the ZHA quirks for Assa Abloy / Yale Zigbee network modules to Quirks v2
  • Added network module state sensors for automatic relock state, language, keypad sound volume
  • Added network module settings for automatic relock time, one-touch relock, privacy button
  • Removed v1 tests
  • Added tests for v2 attribute converters

Additional information

Device diagnostics

{
  "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=43690, maximum_buffer_size=82, maximum_incoming_transfer_size=255, server_mask=0, maximum_outgoing_transfer_size=255, descriptor_capability_field=0)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x000a",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0009",
        "0x000a",
        "0x0020",
        "0x0101"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "Yale",
  "model": "YRD220/240 TSDB",
  "class": "zigpy.device.Device"
}

Please see attached:
Screenshot 2026-08-21 at 21 08 59
Screenshot 2026-08-21 at 21 09 08

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

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.60%. Comparing base (b139f81) to head (7952329).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #5262   +/-   ##
=======================================
  Coverage   92.60%   92.60%           
=======================================
  Files         424      424           
  Lines       14667    14670    +3     
=======================================
+ Hits        13582    13585    +3     
  Misses       1085     1085           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zigpy-review-bot zigpy-review-bot added bot: needs changes PR needs changes per LLM bot: 2.0 migration done PR is on the ZHA/quirks 2.0.0 API (migrated or written for 2.0) per LLM enhancement Improve an existing quirk bot: needs maintainer PR does something questionable that needs a maintainer decision per LLM labels Aug 18, 2026
@zigpy-review-bot zigpy-review-bot changed the title [cleanup] refactor quirk for Yale locks Port Yale lock quirks to quirks v2 and add lock setting sensors Aug 18, 2026
Comment thread zhaquirks/yale/lock.py Outdated
Comment thread tests/test_yale.py
("raw_lang", "expected"),
[
# accounted for mappings
("en", "English"),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do we want to hardcode this or does HA have a built-in converter? According to this document, these should be ISO-639-1 two character codes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

According to Yale's official integrators guide, these are the only three languages that all their locks support, so I think this will do for now.

@zigpy-review-bot zigpy-review-bot changed the title Port Yale lock quirks to quirks v2 and add lock setting sensors Port Yale lock quirks to quirks v2 and add lock setting entities Aug 21, 2026
Comment thread zhaquirks/yale/lock.py
fallback_name="Operating mode",
)
.number(
attribute_name=DoorLock.AttributeDefs.auto_relock_time.name,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

According to the integrator's guide, this value should be able to be set to 0 to disable auto-relock from Zigbee, however, on my lock, this does not work, the auto-relock time only goes from 10-180, all other values fail.

Comment thread zhaquirks/yale/lock.py
.sensor(
endpoint_id=1,
cluster_id=DoorLock.cluster_id,
attribute_name=DoorLock.AttributeDefs.language.name,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This should also be set from Zigbee, but the value won't update.

Comment thread zhaquirks/yale/lock.py
.sensor(
endpoint_id=1,
cluster_id=DoorLock.cluster_id,
attribute_name=DoorLock.AttributeDefs.sound_volume.name,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as this, Yale did mention that only 0 and 2 (mute and high vol) can be set on push-button type locks, however from my testing none can be set.

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

Labels

bot: needs changes PR needs changes per LLM bot: needs maintainer PR does something questionable that needs a maintainer decision per LLM bot: 2.0 migration done PR is on the ZHA/quirks 2.0.0 API (migrated or written for 2.0) per LLM enhancement Improve an existing quirk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants