Documentation ¶
Index ¶
- type DeviceInfo
- type DeviceInfoDefaultStates
- type DeviceInfoResult
- type DeviceInfoState
- type DeviceRunningInfo
- type DeviceRunningInfoResult
- type EnergyUsage
- type EnergyUsageResult
- type Tapo
- func (d *Tapo) DeviceInfo() (map[string]interface{}, error)
- func (d *Tapo) DeviceRunningInfo() (map[string]interface{}, error)
- func (d *Tapo) EnergyUsage() (map[string]interface{}, error)
- func (d *Tapo) GetDeviceInfo() (DeviceInfo, error)
- func (d *Tapo) GetDeviceRunningInfo() (DeviceRunningInfo, error)
- func (d *Tapo) GetEnergyUsage() (EnergyUsage, error)
- func (d *Tapo) Handshake() error
- func (d *Tapo) Login() error
- func (d *Tapo) Request(url string, method string, body map[string]interface{}) (map[string]interface{}, error)
- func (d *Tapo) RequestPath(path string, method string, body map[string]interface{}) (map[string]interface{}, error)
- func (d *Tapo) RequestRaw(url string, method string, body map[string]interface{}) ([]byte, error)
- func (d *Tapo) RequestResult(url string, method string, body map[string]interface{}, result any) error
- func (d *Tapo) TurnOff() (map[string]interface{}, error)
- func (d *Tapo) TurnOn() (map[string]interface{}, error)
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 (*Tapo) DeviceInfo ¶
func (*Tapo) DeviceRunningInfo ¶
func (*Tapo) EnergyUsage ¶
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) RequestPath ¶
func (*Tapo) RequestRaw ¶
func (*Tapo) RequestResult ¶
Click to show internal directories.
Click to hide internal directories.