Skip to content

Conversation

roeemz
Copy link

@roeemz roeemz commented Sep 12, 2025

Add TuyaTripleSwitchDimmer quirk for TS0601 triple-channel dimmers

Description

This PR adds support for Tuya-based triple-channel dimmer switches (TS0601). These devices provide independent control of three lighting channels with full dimming functionality.

Supported Device

  • Model: _TZE204_znvwzxkq (TS0601)
  • Type: Triple-channel dimmer switch
  • Protocol: Zigbee (Tuya MCU)

Implementation Details

  • Endpoints: 3 endpoints (channels) for independent control
  • Clusters: Uses TuyaOnOff and TuyaInWallLevelControl for proper MCU communication
  • Functionality: Full on/off and dimming control for each channel
  • Integration: Proper integration with Tuya's MCU communication protocol

Testing

  • Added comprehensive tests for command functionality across all 3 channels
  • Added tests for dimming value updates and state reporting
  • Tests follow existing patterns and use proper mocking

Files Changed

  • zhaquirks/tuya/ts0601_dimmer.py - Added TuyaTripleSwitchDimmer class
  • tests/test_tuya_dimmer.py - Added test coverage for triple switch functionality

Notes

  • This fills the gap for non-Green Power triple dimmers (GP version already exists)
  • Follows existing repository patterns and coding standards
  • Compatible with existing Tuya MCU infrastructure

- Add support for Tuya triple-channel dimmer switches (TS0601)
- Supports models: _TZE204_znvwzxkq, _TZE284_znvwzxkq, _TZE204_1v1dxkck, _TZE200_vm1gyrso
- Implements 3 endpoints for independent channel control
- Uses TuyaOnOff and TuyaInWallLevelControl clusters
- Add comprehensive tests for command and dimming functionality
- Update device summary documentation
- Remove unverified model identifiers
- Keep only _TZE204_znvwzxkq which is the actual device tested
- Remove unused switch1_cluster variable from test_triple_command
- All pre-commit hooks now pass
- Code is properly formatted with ruff
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.13%. Comparing base (2e2bbd9) to head (dc4cc1e).
⚠️ Report is 4 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #4343   +/-   ##
=======================================
  Coverage   92.13%   92.13%           
=======================================
  Files         358      358           
  Lines       11919    11922    +3     
=======================================
+ Hits        10981    10984    +3     
  Misses        938      938           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Collaborator

@javicalle javicalle left a comment

Choose a reason for hiding this comment

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

LGTM

@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tuya Request/PR regarding a Tuya device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants