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

Adds tapo smart plug GPIO Plugin #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chriswiggins
Copy link

Brings in a tapo smart plug integration for GPIO. This supports devices as follows: https://www.tapo.com/en/product/smart-plug/

The only thing that this requires is the tapo python module, which I'm not sure how to include, or whether or not this project will be happy to have that included? Is there a way to specify this as an optional dependency? I've just been testing by running:

rw
pacman -S python-pip
pip3 install tapo --break-system-packages
ro

I looked into how this was done inside the python module, and its relatively complex so not just as simple as bringing in an HTTP call.

Example /etc/kvmd/override.yaml:

kvmd:
  gpio:
    drivers:
      plug_1:
        type: tapo
        ip: 1.2.3.4
        email: [email protected]
        password: my-super-secure-password

    scheme:
      plug_1_switch:
        driver: plug_1
        pin: 0
        mode: output
        switch: true
        initial: null
        pulse:
          delay: 0
    view:
      header:
        title: Power
      table:
        - ["#Power Switches"]
        - []
        - ["#Switch 1", plug_1_switch]

Please provide any and all feedback!

@mdevaev
Copy link
Member

mdevaev commented Aug 28, 2024

Hello. Do you really need entire rust library for this? This is not packed in distro, and we have no mechanism for optional deps. As I understand, tapo api is just a REST, maybe you can change the plugin to make http calls directly and avoid this dep?

@chriswiggins
Copy link
Author

Hey @mdevaev - very valid point, I did think about that but it initially seemed a bit complex. Let me go back to the drawing board and work out if there's another option 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants