Versions in this module Expand all Collapse all v1 v1.0.1 Apr 29, 2024 Changes in this version + var ErrForbidden = errors.New("Forbidden") v1.0.0 Nov 30, 2023 Changes in this version + const DiscoverV1InitializationVector + type Client struct + func NewClient(logger *log.Logger) *Client + func (c *Client) CloudList() ([]Device, error) + func (c *Client) CloudLogin(username, password string) error + func (c *Client) Discover() (map[string]DiscoverResponse, []DiscoverResponse, error) + type Device struct + Alias string + AppServerURL string + DecodedAlias string + DeviceHwVer string + DeviceID string + DeviceMAC tapoMAC + DeviceModel string + DeviceName string + DeviceRegion string + DeviceType string + FwID string + FwVer string + HwID string + IsSameRegion bool + OemID string + Role int + Status int + type DeviceInfo struct + Avatar string + DecodedNickname string + DecodedSSID string + DefaultStates struct{ ... } + DeviceID string + DeviceON bool + FWID string + FWVersion string + HWID string + HWVersion string + HasSetLocationInfo bool + IP string + Lang string + Latitude int + Location string + Longitude int + MAC string + Model string + Nickname string + OEMID string + OnTime int + OverHeated bool + PowerProtectionStatus string + RSSI int + Region string + SSID string + SignalLevel int + Specs string + TimeDiff int + Type string + type DeviceUsage struct + PowerUsage struct{ ... } + SavedPower struct{ ... } + TimeUsage struct{ ... } + type DiscoverResponse struct + Result struct{ ... } + type DiscoverV1Request struct + CamIpcameraCloud GetInfo + CnCloud GetInfo + IOTCommonCloud GetInfo + System GetSysinfo + func NewDiscoverV1Request() *DiscoverV1Request + type EnergyUsage struct + CurrentPower int + ElectricityCharge [3]int + LocalTime string + MonthEnergy int + MonthRuntime int + TodayEnergy int + TodayRuntime int + type GetDeviceInfoRequest struct + Method string + RequestTimeMils int + func NewGetDeviceInfoRequest() *GetDeviceInfoRequest + type GetDeviceInfoResponse struct + ErrorCode TapoError + Result DeviceInfo + type GetDeviceUsageRequest struct + Method string + RequestTimeMils int + func NewGetDeviceUsageRequest() *GetDeviceUsageRequest + type GetDeviceUsageResponse struct + ErrorCode TapoError + Result DeviceUsage + type GetEnergyUsageRequest struct + Method string + RequestTimeMils int + func NewGetEnergyUsageRequest() *GetEnergyUsageRequest + type GetEnergyUsageResponse struct + ErrorCode TapoError + Result EnergyUsage + type GetInfo struct + GetInfo map[string]string + type GetSysinfo struct + GetSysinfo map[string]string + type HandshakeRequest struct + Method string + Params struct{ ... } + RequestTimeMils int + func NewHandshakeRequest(key string) *HandshakeRequest + type HandshakeResponse struct + ErrorCode TapoError + Result struct{ ... } + type KlapSession struct + Expiry time.Time + LocalSeed []byte + RemoteSeed []byte + SessionID string + UserHash []byte + func NewKlapSession(l *log.Logger) *KlapSession + func (s *KlapSession) Addr() netip.Addr + func (s *KlapSession) Handshake(addr netip.Addr, username, password string) error + func (s *KlapSession) Request(payload []byte) ([]byte, error) + type LoginDeviceRequest struct + Method string + Params struct{ ... } + RequestTimeMils int + func NewLoginDeviceRequest(username, password string) *LoginDeviceRequest + type LoginDeviceResponse struct + ErrorCode TapoError + Result struct{ ... } + type PassthroughSession struct + ID string + IV []byte + Key []byte + func NewPassthroughSession(l *log.Logger) *PassthroughSession + func (p *PassthroughSession) Addr() netip.Addr + func (p *PassthroughSession) Handshake(addr netip.Addr, username, password string) error + func (s *PassthroughSession) Request(requestBytes []byte) ([]byte, error) + type Plug struct + Addr netip.Addr + func NewPlug(addr netip.Addr, logger *log.Logger) *Plug + func (p *Plug) GetDeviceInfo() (*DeviceInfo, error) + func (p *Plug) GetDeviceUsage() (*DeviceUsage, error) + func (p *Plug) GetEnergyUsage() (*EnergyUsage, error) + func (p *Plug) Handshake(username, password string) error + func (p *Plug) IsOn() (bool, error) + func (p *Plug) Off() error + func (p *Plug) On() error + func (p *Plug) SetDeviceInfo(deviceOn bool) error + type SecurePassthroughRequest struct + Method string + Params struct{ ... } + func NewSecurePassthroughRequest(innerRequest string) *SecurePassthroughRequest + type SecurePassthroughResponse struct + ErrorCode TapoError + Result struct{ ... } + type Session interface + Addr func() netip.Addr + Handshake func(addr netip.Addr, username, password string) error + Request func([]byte) ([]byte, error) + type SetDeviceInfoRequest struct + Method string + Params struct{ ... } + func NewSetDeviceInfoRequest(deviceOn bool) *SetDeviceInfoRequest + type SetDeviceInfoResponse struct + ErrorCode TapoError + Result struct{ ... } + type TapoError int + func (te TapoError) Error() string