tapo

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceInfo

type DeviceInfo struct {
	ErrorCode int              `json:"error_code"`
	Result    DeviceInfoResult `json:"result"`
}

type DeviceInfoDefaultStates

type DeviceInfoDefaultStates struct {
	State DeviceInfoState `json:"state"`
	Type  string          `json:"type"`
}

type DeviceInfoResult

type DeviceInfoResult struct {
	AutoOffRemainTime     int                     `json:"auto_off_remain_time"`
	AutoOffStatus         string                  `json:"auto_off_status"`
	Avatar                string                  `json:"avatar"`
	DefaultStates         DeviceInfoDefaultStates `json:"default_states"`
	DeviceID              string                  `json:"device_id"`
	DeviceOn              bool                    `json:"device_on"`
	FwID                  string                  `json:"fw_id"`
	FwVer                 string                  `json:"fw_ver"`
	HasSetLocationInfo    bool                    `json:"has_set_location_info"`
	HwID                  string                  `json:"hw_id"`
	HwVer                 string                  `json:"hw_ver"`
	IP                    string                  `json:"ip"`
	Lang                  string                  `json:"lang"`
	Latitude              int                     `json:"latitude"`
	Longitude             int                     `json:"longitude"`
	Mac                   string                  `json:"mac"`
	Model                 string                  `json:"model"`
	Nickname              string                  `json:"nickname"`
	OemID                 string                  `json:"oem_id"`
	OnTime                int                     `json:"on_time"`
	Overheated            bool                    `json:"overheated"`
	PowerProtectionStatus string                  `json:"power_protection_status"`
	Region                string                  `json:"region"`
	Rssi                  int                     `json:"rssi"`
	SignalLevel           int                     `json:"signal_level"`
	Specs                 string                  `json:"specs"`
	Ssid                  string                  `json:"ssid"`
	TimeDiff              int                     `json:"time_diff"`
	Type                  string                  `json:"type"`
}

type DeviceInfoState

type DeviceInfoState struct {
}

type DeviceRunningInfo

type DeviceRunningInfo struct {
	ErrorCode int                     `json:"error_code"`
	Result    DeviceRunningInfoResult `json:"result"`
}

type DeviceRunningInfoResult

type DeviceRunningInfoResult struct {
	AutoOffRemainTime     int                     `json:"auto_off_remain_time"`
	AutoOffStatus         string                  `json:"auto_off_status"`
	Avatar                string                  `json:"avatar"`
	DefaultStates         DeviceInfoDefaultStates `json:"default_states"`
	DeviceID              string                  `json:"device_id"`
	DeviceOn              bool                    `json:"device_on"`
	FwVer                 string                  `json:"fw_ver"`
	HasSetLocationInfo    bool                    `json:"has_set_location_info"`
	IP                    string                  `json:"ip"`
	Lang                  string                  `json:"lang"`
	Latitude              int                     `json:"latitude"`
	Longitude             int                     `json:"longitude"`
	Nickname              string                  `json:"nickname"`
	OnTime                int                     `json:"on_time"`
	Overheated            bool                    `json:"overheated"`
	PowerProtectionStatus string                  `json:"power_protection_status"`
	Region                string                  `json:"region"`
	Rssi                  int                     `json:"rssi"`
	SignalLevel           int                     `json:"signal_level"`
	Specs                 string                  `json:"specs"`
}

type EnergyUsage

type EnergyUsage struct {
	ErrorCode int               `json:"error_code"`
	Result    EnergyUsageResult `json:"result"`
}

type EnergyUsageResult

type EnergyUsageResult struct {
	CurrentPower      int    `json:"current_power"`
	ElectricityCharge []int  `json:"electricity_charge"`
	LocalTime         string `json:"local_time"`
	MonthEnergy       int    `json:"month_energy"`
	MonthRuntime      int    `json:"month_runtime"`
	TodayEnergy       int    `json:"today_energy"`
	TodayRuntime      int    `json:"today_runtime"`
}

type Tapo

type Tapo struct {
	// contains filtered or unexported fields
}

func NewTapo

func NewTapo(ip string, email string, password string) (*Tapo, error)

func (*Tapo) DeviceInfo

func (d *Tapo) DeviceInfo() (map[string]interface{}, error)

func (*Tapo) DeviceRunningInfo

func (d *Tapo) DeviceRunningInfo() (map[string]interface{}, error)

func (*Tapo) EnergyUsage

func (d *Tapo) EnergyUsage() (map[string]interface{}, error)

func (*Tapo) GetDeviceInfo

func (d *Tapo) GetDeviceInfo() (DeviceInfo, error)

func (*Tapo) GetDeviceRunningInfo

func (d *Tapo) GetDeviceRunningInfo() (DeviceRunningInfo, error)

func (*Tapo) GetEnergyUsage

func (d *Tapo) GetEnergyUsage() (EnergyUsage, error)

func (*Tapo) Handshake

func (d *Tapo) Handshake() error

func (*Tapo) Login

func (d *Tapo) Login() error

func (*Tapo) Request

func (d *Tapo) Request(url string, method string, body map[string]interface{}) (map[string]interface{}, error)

func (*Tapo) RequestPath

func (d *Tapo) RequestPath(path string, method string, body map[string]interface{}) (map[string]interface{}, error)

func (*Tapo) RequestRaw

func (d *Tapo) RequestRaw(url string, method string, body map[string]interface{}) ([]byte, error)

func (*Tapo) RequestResult

func (d *Tapo) RequestResult(url string, method string, body map[string]interface{}, result any) error

func (*Tapo) TurnOff

func (d *Tapo) TurnOff() (map[string]interface{}, error)

func (*Tapo) TurnOn

func (d *Tapo) TurnOn() (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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