Documentation
¶
Overview ¶
Package plugctl provides an API for controlling Kasa smart home switches.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plug ¶
type Plug struct {
Addr string
}
Plug provides an API for a single Kasa smart home plug or switch.
func (*Plug) RelayState ¶
RelayState reports whether the plug is currently on.
func (*Plug) SetRelayState ¶
SetRelayState turns the plug on or off.
type SysInfo ¶
type SysInfo struct { SWVer string `json:"sw_ver,omitempty"` // e.g. "1.0.3 Build 210506 Rel.105435", HWVer string `json:"hw_ver,omitempty"` // e.g. "1.0", Model string `json:"model,omitempty"` // e.g. "KP105(AU)", DeviceID string `json:"deviceId,omitempty"` // e.g. "8006CF0E89296D2A5BFBDE11C844BB2B1E2D2B7C", OEMID string `json:"oemId,omitempty"` // e.g. "EAB15315847573797920EFE7E9000562", HWID string `json:"hwId,omitempty"` // e.g. "120EF751A1A4F170831E6C1F57D97B38", RSSI int `json:"rssi,omitempty"` // e.g. -58, LongitudeI int `json:"longitude_i,omitempty"` // e.g. 1473005, LatitudeI int `json:"latitude_i,omitempty"` // e.g. -428429, Alias string `json:"alias,omitempty"` // e.g. "Car charger", Status string `json:"status,omitempty"` // e.g. "new", MICType string `json:"mic_type,omitempty"` // e.g. "IOT.SMARTPLUGSWITCH", Feature string `json:"feature,omitempty"` // e.g. "TIM", MAC string `json:"mac,omitempty"` // e.g. "00:5F:67:01:A5:50", Updating int `json:"updating,omitempty"` // e.g. 0, LEDOff int `json:"led_off,omitempty"` // e.g. 0, OBDSrc string `json:"obd_src,omitempty"` // e.g. "tplink", RelayState int `json:"relay_state,omitempty"` // e.g. 0, OnTime int `json:"on_time,omitempty"` // e.g. 0, ActiveMode string `json:"active_mode,omitempty"` // e.g. "schedule", IconHash string `json:"icon_hash,omitempty"` // e.g. "", DevName string `json:"dev_name,omitempty"` // e.g. "Smart Wi-Fi Plug", NextAction struct { Type int `json:"type,omitempty"` } `json:"next_action,omitempty"` // e.g. {"type": -1}, NTCState int `json:"ntc_state,omitempty"` // e.g. 0, ErrCode int `json:"err_code,omitempty"` // e.g. 0 }
Click to show internal directories.
Click to hide internal directories.