Documentation ¶
Index ¶
- Constants
- type Client
- func (c Client) DeviceInfo() (*DeviceInfoData, error)
- func (c Client) FlashFirmware(filePath string) error
- func (c Client) PowerOnState(state PowerOnState) error
- func (c Client) SleepTimer(state State, duration int) error
- func (c Client) Switch(state State) error
- func (c Client) UnlockOTA() error
- func (c Client) WiFiConfig(ssid, password string) error
- func (c Client) WiFiSignal() (int, error)
- type DeviceInfoData
- type PowerOnState
- type Response
- type ResponseError
- type State
- type WiFiSignalData
Constants ¶
View Source
const ( PowerOnStateOn PowerOnState = "on" PowerOnStateOff PowerOnState = "off" PowerOnStateStay PowerOnState = "stay" StateOn State = "on" StateOff State = "off" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) DeviceInfo ¶
func (c Client) DeviceInfo() (*DeviceInfoData, error)
func (Client) FlashFirmware ¶
func (Client) PowerOnState ¶
func (c Client) PowerOnState(state PowerOnState) error
func (Client) SleepTimer ¶ added in v1.1.0
func (Client) WiFiConfig ¶
func (Client) WiFiSignal ¶
type DeviceInfoData ¶
type PowerOnState ¶
type PowerOnState string
type Response ¶
type Response struct { // The order of device status update (also the order of TXT Record update) Seq int `json:"seq"` // Whether the device successfully sets the specified device information. // - 0: Successfully // - 400: The operation failed and the request was formatted incorrectly. // The request body is not a valid JSON format. // - 401: The operation failed and the request was unauthorized. // Device information encryption is enabled on the device, but the request is not encrypted. // - 404: The operation failed and the device does not exist. // The device does not support the requested deviceid. // - 422: The operation failed and the request parameters are invalid. // For example, the device does not support setting specific device information. Error int `json:"error"` // Object type, it returns specific device info when check the device information Data json.RawMessage `json:"data"` }
func (Response) UnmarshalData ¶
type ResponseError ¶
type ResponseError struct {
// contains filtered or unexported fields
}
func (ResponseError) Code ¶
func (e ResponseError) Code() int
func (ResponseError) Error ¶
func (e ResponseError) Error() string
type WiFiSignalData ¶
type WiFiSignalData struct {
SignalStrength int `json:"signalStrength"`
}
Click to show internal directories.
Click to hide internal directories.