api

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestData added in v1.3.0

func RequestData[T any](d *ApiClient, method string, params interface{}) (T, error)

func RequestVoid added in v1.3.0

func RequestVoid(d *ApiClient, method string, params interface{}) error

Types

type ApiClient

type ApiClient struct {
	Ip          net.IP
	Email       string
	Password    string
	HandshakeTS time.Time
	// contains filtered or unexported fields
}

ApiClient is the main struct to interact with the raw Tapo API.

func NewClient

func NewClient(ip, email, password string) (*ApiClient, error)

NewClient creates a new ApiClient.

func (*ApiClient) Login

func (d *ApiClient) Login() error

Login logs in to the Tapo API.

func (*ApiClient) RefreshSession

func (d *ApiClient) RefreshSession() error

RefreshSession refreshes the authentication session of the client.

func (*ApiClient) Request

func (d *ApiClient) Request(method string, params interface{}) ([]byte, error)

Request sends a request to the Tapo API.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL