Documentation ¶
Index ¶
- type ActionParam
- type Client
- func (c *Client) Close() error
- func (c *Client) ConfigRouter(ssid string, passwd string, uid string) ([]byte, error)
- func (c *Client) DoAction(param ActionParam) ([]byte, error)
- func (c *Client) GetProps(params ...PropParam) ([]byte, error)
- func (c *Client) Info() ([]byte, error)
- func (c *Client) OTA(url string, fileMD5 string) ([]byte, error)
- func (c *Client) OTAProgress() ([]byte, error)
- func (c *Client) OTAState() ([]byte, error)
- func (c *Client) Send(method string, params interface{}) ([]byte, error)
- func (c *Client) SetDid(did string) *Client
- func (c *Client) SetProps(params ...PropParam) ([]byte, error)
- func (c *Client) SetToken(token string) *Client
- type Info
- type PropParam
- type PropParams
- type PropParamsReq
- type PropRet
- type PropRets
- type Ret
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionParam ¶
type ActionParam struct { Did string `json:"did"` Siid int `json:"siid"` Aiid int `json:"aiid"` In []any `json:"in,omitempty"` Out []any `json:"out,omitempty"` }
func (*ActionParam) SetDid ¶
func (a *ActionParam) SetDid(did string) *ActionParam
type Client ¶
Client is device client that extends protocol connection.
func (*Client) ConfigRouter ¶
ConfigRouter configures wifi network on device.
func (*Client) DoAction ¶
func (c *Client) DoAction(param ActionParam) ([]byte, error)
Action execute device action.
func (*Client) OTAProgress ¶
OTAProgress requests OTA update progress.
type Info ¶
type Info struct { Life int `json:"life"` Model string `json:"model"` Token string `json:"token"` Ipflag int `json:"ipflag"` MiioVer string `json:"miio_ver"` HwVer string `json:"hw_ver"` Mmfree int `json:"mmfree"` FwVer string `json:"fw_ver"` Mac string `json:"mac"` WifiFwVer string `json:"wifi_fw_ver"` Ap struct { Ssid string `json:"ssid"` Bssid string `json:"bssid"` Rssi int `json:"rssi"` Primary int `json:"primary"` } `json:"ap"` Netif struct { LocalIP string `json:"localIp"` Mask string `json:"mask"` Gw string `json:"gw"` } `json:"netif"` PartnerID string `json:"partner_id"` }
type PropParam ¶
type PropParams ¶
type PropParams []PropParam
type PropParamsReq ¶
type PropParamsReq struct { Params PropParams `json:"params"` Method string `json:"method,omitempty"` }
Click to show internal directories.
Click to hide internal directories.