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 PM2.5 for Tuya Smart Air House keeper #2837

Merged
merged 2 commits into from
Dec 23, 2023
Merged

Conversation

alrassia
Copy link
Contributor

Proposed change

Add capability to read PM25 values from Tuya Smart House keeper devices and split device into separate quirk.
This is my first pull request ever and also a first attempt at python so any guidance is appreciated.

Additional information

also synced the supported models with those supported by Zigbee2MQTT

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

	modified:   zhaquirks/tuya/air/ts0601_air_quality.py
	new file:   zhaquirks/tuya/air/ts0601_smart_air.py
	modified:   zhaquirks/tuya/air/ts0601_air_quality.py
	new file:   zhaquirks/tuya/air/ts0601_smart_air.py

	modified:   tests/test_tuya_air.py
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a0c4109) 87.37% compared to head (ecc9441) 87.39%.
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2837      +/-   ##
==========================================
+ Coverage   87.37%   87.39%   +0.01%     
==========================================
  Files         287      288       +1     
  Lines        8848     8860      +12     
==========================================
+ Hits         7731     7743      +12     
  Misses       1117     1117              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Dec 20, 2023
@TheJulianJES TheJulianJES changed the title Improve support for Smart Air House keeper Add PM2.5 for Tuya Smart Air House keeper Dec 23, 2023
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.

LGTM. Big thanks for also adding tests!

replacement = {
ENDPOINTS: {
1: {
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Noticed ON_OFF_LIGHT as a type when reviewing. The previous/other Tuya "air-related" quirks also use this, so I guess it's fine/there's a reason, but we might wanna take a look at this in the future again.

@TheJulianJES TheJulianJES merged commit cbe010c into zigpy:dev Dec 23, 2023
14 checks passed
elupus pushed a commit to elupus/zha-device-handlers that referenced this pull request Jan 17, 2024
lgraf pushed a commit to lgraf/zha-device-handlers that referenced this pull request May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tuya Request/PR regarding a Tuya device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants