Skip to content

Instantly share code, notes, and snippets.

@danesparza
Created August 4, 2018 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danesparza/a1ccf0b5fd9afe7ceef9d9fd18cbdabc to your computer and use it in GitHub Desktop.
Save danesparza/a1ccf0b5fd9afe7ceef9d9fd18cbdabc to your computer and use it in GitHub Desktop.
TPLink smart plug energy meter working smoke test
package main
import (
"fmt"
"log"
"github.com/danesparza/tplink"
)
func main() {
ip := "192.168.1.85" // Your device IP
plug := tplink.NewHS110(ip)
meter, err := plug.Meter()
if err != nil {
log.Fatalf("failed: %s\n", err)
}
fmt.Printf("Result: %+v\n", meter)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment