Skip to content

Conversation

jezzaaa
Copy link

@jezzaaa jezzaaa commented Aug 8, 2025

Proposed change

This change is to add a quirk for the Tuya TS0601 vibration sensor that provides sensors for accelerometer data.

Additional information

This quirk replaces a generic quirk that works only for vibration status, but presents no sensors for accelerometer data.

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
    I don't know how to write a test for the code. It loads correctly, allows pairing, and correctly presents the data without errors in the log.

Copy link

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.13%. Comparing base (2e2bbd9) to head (3b4b478).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #4242   +/-   ##
=======================================
  Coverage   92.13%   92.13%           
=======================================
  Files         358      359    +1     
  Lines       11919    11931   +12     
=======================================
+ Hits        10981    10993   +12     
  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.

@jezzaaa
Copy link
Author

jezzaaa commented Aug 9, 2025

I don't know how to fix the Codecov errors. It doesn't seem to be exercising my converter function. Some of the other quirks in the codebase (that use the TuyaQuirkBuilder) have a similar structure to mine, with the converter function being referenced only in the .sensor/.enum/.whatever definition, and nowhere else, and with the converter function defined similarly to how I'm doing it. Some guidance on this issue would be grateful.

@TheJulianJES TheJulianJES added Tuya Request/PR regarding a Tuya device needs reviewer answer An answer from a reviewer is needed (e.g. why a PR isn't acceptable in the current state). labels Aug 24, 2025
@TheJulianJES TheJulianJES changed the title Added V2 quirk for Tuya ts0601 vibration sensor that includes accelerometer data Add Tuya vibration sensor with accelerometer _TZE200_iba1ckek Aug 24, 2025
@weboide
Copy link

weboide commented Sep 9, 2025

Works as intended. This adds the x, y and z acceleration values.

Tested in 2025.8.3

@jezzaaa
Copy link
Author

jezzaaa commented Sep 14, 2025

@TheJulianJES I believe all of the Codecov issues have been resolved, with new test code incorporated into the PR. What's the next stage for having this PR accepted? Thankyou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reviewer answer An answer from a reviewer is needed (e.g. why a PR isn't acceptable in the current state). Tuya Request/PR regarding a Tuya device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants