tapo

command module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 5 Imported by: 0

README

Tapo SmartPlug API Client

About

Implementation of Tapo API using a reverse engineering blog post.

Library

    import (
        "github.com/richardjennings/tapo/pkg/tapo"
    )

    var t *tapo.Tapo
    var r map[string]interface{}
    var err error

    t, err = tapo.NewTapo("192.168.0.200", "username", "password")
    r, err = t.TurnOn()
    r, err = t.TurnOff()
    r, err = t.GetEnergyUsage()
    r, err = t.DeviceInfo()

CLI

go install github.com/richardjennings/tapo

Usage
tapo <ip-address> <username> <password> [on, off, energy-usage, device-info]

For example:

tapo 192.168.0.101 email@address thepassword energy-usage
{
  "error_code": 0,
  "result": {
    "current_power": 0,
    ...
    "month_energy": 10000,
    "month_runtime": 10000,
    "today_energy": 400,
    "today_runtime": 300
  }
}

Used By

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL