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

Adding new ts0042 model #1376

Merged
merged 4 commits into from
Feb 23, 2022
Merged

Adding new ts0042 model #1376

merged 4 commits into from
Feb 23, 2022

Conversation

MattWestb
Copy link
Contributor

@MattWestb MattWestb commented Feb 20, 2022

Adding one new model with 4 endpoints as the ts0044 but is only using the 2 first (hard and software recycling on high level from tuya then using the same for all switches and only changing the device ID !!).
Putting back the device type and moving OnOff to out and deleting power config from all EP but keeping it on EP1 so battery reporting is working better.

Fixes: #1375

The old is untouched but need being updated in the same way.

Adding one new model with 4 endpoints  as the ts0044 but is only using the 2 first.
Putting back the device type and moving OnOff to out and deleting power config from all EP but keeping it on EP1 sp battery reporting is working better.
@codecov-commenter
Copy link

Codecov Report

Merging #1376 (cb533d8) into dev (f9e25f4) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #1376      +/-   ##
==========================================
+ Coverage   81.06%   81.07%   +0.01%     
==========================================
  Files         218      218              
  Lines        6093     6097       +4     
==========================================
+ Hits         4939     4943       +4     
  Misses       1154     1154              
Impacted Files Coverage Δ
zhaquirks/tuya/ts0042.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f9e25f4...cb533d8. Read the comment docs.

@coveralls
Copy link

coveralls commented Feb 20, 2022

Pull Request Test Coverage Report for Build 1881354174

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 81.073%

Totals Coverage Status
Change from base Build 1865472061: 0.01%
Covered Lines: 4943
Relevant Lines: 6097

💛 - Coveralls

@javicalle
Copy link
Collaborator

The old is untouched but need being updated in the same way.

@MattWestb , does that mean that the TuyaSmartRemoteOnOffCluster cluster would not be needed to maintain the functionality of these devices?

It sounds like it could be completely removed (which would be an improvement).

@MattWestb
Copy link
Contributor Author

TuyaSmartRemoteOnOffCluster is being used of all ts004x devices (5 quirks) and its needed then the device is sending no ZCL commands 0xFD on cluster 0x0006 with press types:

class TuyaSmartRemoteOnOffCluster(OnOff, EventableCluster):
"""TuyaSmartRemoteOnOffCluster: fire events corresponding to press type."""
press_type = {
0x00: SHORT_PRESS,
0x01: DOUBLE_PRESS,
0x02: LONG_PRESS,

Also adding sending default response so the switch is not repeating the commands and doing delays / blocking the device then the command is out of ZCL..

I only doing the trick deleting the cluster 0x0006 from in and adding it as one out cluster on the same endpoint (that it shall have being) and we dont getting any no working switch in ZHA GUI but its still working and is tested on 3 devices we have trying (ts0044, ts0042 and ts004f).

As you see its real tyua devices = you is getting what you is paying for.

@javicalle
Copy link
Collaborator

Sorry, you're right, I got confused when reviewing the changes you had made.
I don't know why I thought you were using the OnOff cluster and not the TuyaSmartRemoteOnOffCluster 🤦🏻‍♂️

@MattWestb
Copy link
Contributor Author

MattWestb commented Feb 20, 2022

Its tuya devices so many things is little more then strange.
The ts004f rotating knob in "scene mode" is sending command 0xFC with 0x00: ROTATE_RIGHT, 0x01: ROTATE_LEFT and 0x02: ROTATE_STOP on cluster 0x0006 but its not ready then all commands is not encoded and implanted. And i have ordering one from France so can testing and sniffing if its needed but its still on the way.

I think its one part of housekeeping fixing bad things like this (deleting not working functions that making problem for users).

@MattWestb
Copy link
Contributor Author

Using the unknown cluster from INIT that makes if we is finding some functions of it then the device is getting the function we is implanting in the future.

@dmulcahey dmulcahey merged commit 71ca27c into zigpy:dev Feb 23, 2022
@MattWestb MattWestb deleted the patch-2 branch February 23, 2022 12:17
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] TS0042 by _TZ3000_wjr2jjrm
5 participants