Categorygithub.com/ivanbeldad/kasa-go
repositorypackage
0.0.0-20220829112411-22edc59c0fbd
Repository: https://github.com/ivanbeldad/kasa-go.git
Documentation: pkg.go.dev

# README

Kasa Go

Version License

Go library to remotely control TP-Link devices using their cloud web service so they can be controlled from outside the network.

Installation

go get github.com/ivanbeldad/kasa-go

Devices Supported

DeviceType
HS100Smart Plug
HS103Smart Plug
HS110Smart Plug
HS200Smart Light Switch

Smart Plugs

MethodDescription
GetInfoGet information about the smart plug
TurnOnTurn on the device
TurnOffTurn off the device
SwitchOnOffChange the state of the device
RebootPower off the device and power on after a few seconds
GetAliasGet the name of the device
ScanAPsScan near access points and return info about them

Example

api, err := kasa.Connect("[email protected]", "myStrongPassword")
if err != nil {
  log.Fatal(err)
}
hs100, err := api.GetHS100("livingroom")
if err != nil {
  log.Fatal(err)
}
err = hs100.TurnOn()
if err != nil {
  log.Fatal(err)
}
fmt.Print("Living Room turned on successfully!")

License

Kasa Go is open-sourced software licensed under the MIT license.