Created
August 4, 2018 17:28
-
-
Save danesparza/a1ccf0b5fd9afe7ceef9d9fd18cbdabc to your computer and use it in GitHub Desktop.
TPLink smart plug energy meter working smoke test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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