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

Change to new Tuya EnchantedDevice import path #2942

Conversation

TheJulianJES
Copy link
Collaborator

@TheJulianJES TheJulianJES commented Jan 27, 2024

Proposed change

This changes the imports for the EnchantedDevice class from the old path to the new path:

- from zhaquirks.tuya.mcu import EnchantedDevice
+ from zhaquirks.tuya import EnchantedDevice

Additional information

This changes the imports to the new EnchantedDevice path as mentioned in this related PR:

As mentioned in that PR, it's still impossible to import EnchantedDevice from zhaquirks.tuya.mcu in order to keep backwards compatibility with custom quirks that haven't updated.

But it only makes sense to update zha-quirks to import from the "correct"/new location already, hence this PR.

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 code quality Improvement to code quality labels Jan 27, 2024
Copy link

codecov bot commented Jan 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c55555e) 87.62% compared to head (8b2a0f7) 87.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2942      +/-   ##
==========================================
- Coverage   87.62%   87.62%   -0.01%     
==========================================
  Files         295      295              
  Lines        9045     9039       -6     
==========================================
- Hits         7926     7920       -6     
  Misses       1119     1119              

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

@TheJulianJES TheJulianJES merged commit 0336e0d into zigpy:dev Jan 27, 2024
14 checks passed
@jesuslobo
Copy link

It seems that this commit has messed something with tuya/ts001x.py as my devices stopped working. Reverting to the quirk from previous tag fixed my issue. If any more information is needed I can provide any logs/traces/anything

@TheJulianJES
Copy link
Collaborator Author

@jesuslobo Can you describe what setup you're using? (Custom quirks?)
There are other changes required for this to work:

@jesuslobo
Copy link

My previous custom quirks were:

  • texasinstruments/router.py
  • tuya/ts0001_fingerbot.py
  • xiaomi/aqara/motion_aq2.py
  • xiaomi/aqara/weather.py
  • xiaomi/mijia/sensor_ht.py

Maybe (probably) outdated, but working AFAIK. Yesterday i've to add tuya/ts001x.py to get it working again.

I'm out now, but if you need any other info, I can provide it when at home.

@TheJulianJES
Copy link
Collaborator Author

Those custom quirks are all included in HA already. You should not need to use any custom quirks.
What HA version are you running?

@jesuslobo
Copy link

jesuslobo commented Jan 29, 2024

Latest, I check daily for docker image updates dia watchtower. I can't exactly remember why I had to use custom quirks for those items (they are from past year aug/sep), possibly because some upgrade related malfunction like yesterday's ts001x

HA Versions:
Core - 2024.1.5
Frontend - 20240104.0

lgraf pushed a commit to lgraf/zha-device-handlers that referenced this pull request May 6, 2024
`EnchantedDevice` is now imported from `zhaquirks.tuya`, rather than from `zhaquirks.tuya.mcu`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Improvement to code quality Tuya Request/PR regarding a Tuya device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants