-
Notifications
You must be signed in to change notification settings - Fork 729
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
Add Tuya single button switch TS004F
_TZ3000_ja5osu5g
#3153
Conversation
Existing signature before quirk: { "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4742, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": "0x0104", "device_type": "0x0000", "input_clusters": [ "0x0000", "0x0001", "0x0003", "0x0004", "0x0006", "0x1000", "0xe001" ], "output_clusters": [ "0x0003", "0x0004", "0x0006", "0x0008", "0x000a", "0x0019", "0x1000" ] } }, "manufacturer": "_TZ3000_ja5osu5g", "model": "TS004F", "class": "zigpy.device.Device" } Signature after quirk: { "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4742, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": "0x0104", "device_type": "0x0820", "input_clusters": [ "0x0000", "0x0001", "0x0003", "0x0004", "0x1000", "0xe001" ], "output_clusters": [ "0x0003", "0x0004", "0x0006", "0x0008", "0x000a", "0x0019", "0x0300", "0x1000" ] } }, "manufacturer": "_TZ3000_ja5osu5g", "model": "TS004F", "class": "ts004f.TuyaSmartRemote004FSK_v2" }
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #3153 +/- ##
=======================================
Coverage 88.14% 88.14%
=======================================
Files 299 299
Lines 9389 9391 +2
=======================================
+ Hits 8276 8278 +2
Misses 1113 1113 ☔ View full report in Codecov by Sentry. |
Great you was getting it working and doing on PR !!! Naming of the class naming and reusing the old class DA is up to the maintainers but for me its looks OK !! |
PS: add in the first post for linking the issue: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
There are some minor changes that could be made to clean this up slightly.
TS004F
_TZ3000_ja5osu5g
Thanks - I had no idea exactly what I was doing with this, just what I managed to get working... I was hoping that someone with more of a clue could optimise it :) I think I've done what you've asked properly - if you could please give it your eyeballs again and confirm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks!
Not sure if it's a quirk implementation issue, but the TS004F by _TZ3000_ja5osu5g (Single Button) seems to have issues interpreting data. Although the commands are pretty straight forward for toggle, on and off:
the switch would trigger back on by itself upon receiving this one (note Bool.true:1) with no user interaction:
|
If you hold the button down for ~3-4 seconds, it should change modes and work properly. |
@AnalogThinker Pleas post the diagnostic from the device card so can see with quirk (if) its using. |
Sure thing.
|
The second one shall working "normal" then its have loading the the quirk for one switch. |
Please add also _TZ3000_egvb1p2g model, added model as mentioned in #2212 (reply in thread) works great. Existing signature before quirk:
|
Existing signature before quirk:
Signature after quirk:
Tested in HA, and HA correctly receives button presses now:
Fixes #2212
Checklist
pre-commit
checks pass / the code has been formatted using Black