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 Tuya Namron thermostat _TZE204_p3lqqy2r #3625

Merged
merged 15 commits into from
Dec 22, 2024

Conversation

prairiesnpr
Copy link
Collaborator

Proposed change

Adds _TZE204_p3lqqy2r

Additional information

Fixes: #2868
Closes: #3565

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

@TheJulianJES TheJulianJES added Tuya Request/PR regarding a Tuya device needs review This PR should be reviewed soon, as it generally looks good. v2 quirk Quirks using v2 API. Might add custom entities that need translation keys in HA. labels Dec 20, 2024
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.89%. Comparing base (979551d) to head (a4fa8fb).
Report is 5 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3625      +/-   ##
==========================================
+ Coverage   89.85%   89.89%   +0.03%     
==========================================
  Files         321      322       +1     
  Lines       10374    10407      +33     
==========================================
+ Hits         9322     9355      +33     
  Misses       1052     1052              

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

@mellowism
Copy link

mellowism commented Dec 20, 2024

image
image
image
Everything is working as it should now.

@prairiesnpr prairiesnpr marked this pull request as ready for review December 20, 2024 22:40
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.

Looks good!

zhaquirks/tuya/ts0601_thermostat.py Show resolved Hide resolved
zhaquirks/tuya/ts0601_thermostat.py Outdated Show resolved Hide resolved
zhaquirks/tuya/ts0601_thermostat.py Outdated Show resolved Hide resolved
tests/test_tuya_thermostat.py Outdated Show resolved Hide resolved
@TheJulianJES TheJulianJES changed the title Add Tuya _TZE204_p3lqqy2r Add Tuya Namron thermostat _TZE204_p3lqqy2r Dec 20, 2024
@TheJulianJES TheJulianJES added needs reviewer answer An answer from a reviewer is needed (e.g. why a PR isn't acceptable in the current state). and removed needs review This PR should be reviewed soon, as it generally looks good. labels Dec 20, 2024
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! I think we can go with this.
In the future, I wanna look into exposing (basic) climate devices directly via quirks v2 potentially.

tests/test_tuya_thermostat.py Outdated Show resolved Hide resolved
@TheJulianJES TheJulianJES merged commit 00aad65 into zigpy:dev Dec 22, 2024
9 checks passed
Comment on lines +177 to +218
.tuya_sensor(
dp_id=120,
attribute_name="current",
type=t.int16s,
divisor=10,
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
unit=UnitOfElectricCurrent.AMPERE,
translation_key="current",
fallback_name="Current",
)
.tuya_sensor(
dp_id=121,
attribute_name="voltage",
type=t.int16s,
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
unit=UnitOfElectricPotential.VOLT,
translation_key="voltage",
fallback_name="Voltage",
)
.tuya_sensor(
dp_id=122,
attribute_name="power",
type=t.int16s,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
unit=UnitOfPower.WATT,
translation_key="power",
fallback_name="Power",
)
.tuya_sensor(
dp_id=123,
attribute_name="energy",
type=t.int16s,
divisor=100,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL,
unit=UnitOfEnergy.KILO_WATT_HOUR,
translation_key="energy",
fallback_name="Energy",
)
Copy link
Collaborator

@TheJulianJES TheJulianJES Dec 23, 2024

Choose a reason for hiding this comment

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

uh, I missed this too: I think we do not want a translation_key for these, as HA will use the device_class name by default.
We should remove the translation_key for these four sensors.

EDIT: See #3630

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 v2 quirk Quirks using v2 API. Might add custom entities that need translation keys in HA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Device Support Request] Namron Zigbee Touch Thermostat 16A 4512752/4512753
3 participants