Skip to content

Fix Tuya presence sensor "distance tracking" for _ya4ft0w4 #4187

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

Merged

Conversation

rrooggiieerr
Copy link
Contributor

The switch actually enables/disables distance tracking instead of a LED indicator. Renaming the switch to what it actually does prevents a lot of confusion.

Proposed change

Additional information

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

The switch actually enables/disables distance tracking instead of a LED indicator. Renaming the switch to what it actually does prevents a lot of confusion.
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.30%. Comparing base (a24ba30) to head (a6c868a).
⚠️ Report is 9 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #4187   +/-   ##
=======================================
  Coverage   91.30%   91.30%           
=======================================
  Files         340      340           
  Lines       10993    10993           
=======================================
  Hits        10037    10037           
  Misses        956      956           

☔ 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.

@TheJulianJES TheJulianJES added Tuya Request/PR regarding a Tuya device needs review This PR should be reviewed soon, as it generally looks good. labels Jul 15, 2025
@TheJulianJES TheJulianJES added the bugfix This PR fixes a bug label Jul 30, 2025
Copy link
Collaborator

@TheJulianJES TheJulianJES left a comment

Choose a reason for hiding this comment

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

Thanks! We may also need to change this for other Tuya presence sensors(?)

Also note that this will create a new entity, since the attribute_name has changed (which we use for the entity unique ID in HA), but that's actually what we want here, since users might have already changed the default name to something else, e.g. "LED light", so they wouldn't see the correct name.
With this, we properly create a new entity that actually does what it says.

@TheJulianJES TheJulianJES changed the title Rename LED Indicator to Distance Tracking for _TZE200_ya4ft0w4/_TZE204_ya4ft0w4 Fix Tuya presence sensor "distance tracking" for _ya4ft0w4 Jul 30, 2025
@TheJulianJES TheJulianJES merged commit 069d089 into zigpy:dev Jul 30, 2025
9 checks passed
@TheJulianJES TheJulianJES removed the needs review This PR should be reviewed soon, as it generally looks good. label Jul 30, 2025
@rrooggiieerr
Copy link
Contributor Author

I'm not sure if other Tuya presence sensors need to be changed, I only have experience with the sensors covered by this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR fixes a bug Tuya Request/PR regarding a Tuya device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants