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

Implemented control for Tuya smart plugs #846

Closed
wants to merge 2 commits into from
Closed

Conversation

fer662
Copy link

@fer662 fer662 commented Apr 29, 2024

I bought a Tuya smart plug to make my printer power off after prints if left unused but didn't find support for it, so I added it.

@Arksine
Copy link
Owner

Arksine commented Apr 30, 2024

Thanks. Unfortunately the tinytuya module is not compatible with Moonraker, as it includes blocking code and attempts to install the cryptography dependency which breaks some installations. See the contributing documentation for additional details.

Generally speaking I prefer to avoid adding new http integrations directly in the power component, as there are simply too many devices, manufacturers, and protocols. Instead I recommend using the generic http when possible. This may not be possible with a Tuya plug, in which case third party software like Home Assistant may be an alternative. A Tuya implementation in Moonraker would likely need to be done from scratch, with non-blocking code and without depending on modules like cryptography that cannot be built on low-resource SBCs.

@fer662
Copy link
Author

fer662 commented Apr 30, 2024

I understand what you mean, but this works fine for my use case, which is basically the printer commits suicide and turns itself off (including the raspberry) a few mins after getting cold enough. It's not too important to me if the blocking calls are handled properly at that point. Thought i'd leave a reference to my fork in case that's what someone else needs, even if it doesn't reach the standards for merging. The plugs that are supported are much harder to find in many places.

@Arksine
Copy link
Owner

Arksine commented Sep 6, 2024

Thanks. I'm going to go ahead and close this PR since it cannot be merged, however its reference is still available in the feature request, so users should be able to find it.

@Arksine Arksine closed this Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants