Skip to content

ivanbeldad/kasa-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Device Type
HS100 Smart Plug
HS103 Smart Plug
HS110 Smart Plug
HS200 Smart Light Switch

Smart Plugs

Method Description
GetInfo Get information about the smart plug
TurnOn Turn on the device
TurnOff Turn off the device
SwitchOnOff Change the state of the device
Reboot Power off the device and power on after a few seconds
GetAlias Get the name of the device
ScanAPs Scan near access points and return info about them

Example

api, err := kasa.Connect("tplink@mail.com", "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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages