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

Add some ts0601_motion devices (with Tuya MCU Cluster approach) #1315

Merged
merged 6 commits into from
Feb 15, 2022

Conversation

javicalle
Copy link
Collaborator

@javicalle javicalle commented Jan 30, 2022

This PR will add support for some ts0601_motion devices.

The new devices will follow the new 'Tuya MCU Cluster' approach to update device attributes.

Fixes: #1236
Reported motion sensor 'NAS-PD07' manufactured by NEO.
Most of the code came from 'herdsman-converters'
Those DPs that have been possible are reported as a new cluster.
Those that I have not found a match for are reported as attributes of the MCU cluster.

Not sure about possible tamper values. Probably there are diferent values >0 with other meanings.

Fixes: #1312
Unknown sensor, from unknown manufacturer.
The functionality of most DPs is unknown. They are probably used to configure device settings.
The known DPs (occupancy, illuminance, target_distance) have been implemented according to the information provided by the manufacturer.

@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2022

Codecov Report

Merging #1315 (f51250d) into dev (c6837b9) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #1315      +/-   ##
==========================================
+ Coverage   80.97%   81.11%   +0.14%     
==========================================
  Files         217      217              
  Lines        6008     6054      +46     
==========================================
+ Hits         4865     4911      +46     
  Misses       1143     1143              
Impacted Files Coverage Δ
zhaquirks/tuya/ts0601_motion.py 100.00% <100.00%> (ø)
zhaquirks/tuya/ts001x.py 100.00% <0.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 c6837b9...f51250d. Read the comment docs.

@coveralls
Copy link

coveralls commented Jan 30, 2022

Pull Request Test Coverage Report for Build 1781218346

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

Totals Coverage Status
Change from base Build 1746729190: 0.1%
Covered Lines: 4911
Relevant Lines: 6054

💛 - Coveralls

@MattWestb
Copy link
Contributor

The tamper attribute looks very OK.
The battery is little tricky then its also having USB powered "mode".
If it was not having it some TRVs is converting battery low warning to 20% battery and no warming 100% (*2 for ZCL compatibility) so i think you have doing the best what can being done.

One way is having the "tuya battery attribute" and also doing the % converting (then USB = 100% *2) to the normal battery attribute for getting the normal ZHA battery sensor showing "somthing" and the user can getting the real sate from tuya battery attribute if they like that.

@javicalle javicalle marked this pull request as ready for review February 11, 2022 00:07
@javicalle javicalle added the needs final review PR is ready for a final review from a maintainer label Feb 11, 2022
@dmulcahey dmulcahey merged commit 2d5a2ef into zigpy:dev Feb 15, 2022
@javicalle javicalle deleted the ts0601_motion branch February 22, 2022 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs final review PR is ready for a final review from a maintainer
Projects
None yet
5 participants