You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
774 B
Go
47 lines
774 B
Go
7 months ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
"fmt"
|
||
|
"mijia-go-sdk/api"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
user := "15542100924"
|
||
|
pwd := "1XAII@wsk"
|
||
|
result, _ := api.Login(user, pwd)
|
||
|
marshal, err := json.Marshal(result)
|
||
|
if err != nil {
|
||
|
return
|
||
|
}
|
||
|
Mi := api.NewMiJia(result)
|
||
|
//Mi.Rooms()
|
||
|
//Mi.Devices()
|
||
|
//Mi.Scenes(0)
|
||
|
//Mi.RunScene("1784216758920822784")
|
||
|
|
||
|
var data []map[string]interface{}
|
||
|
|
||
|
data = append(data, map[string]interface{}{
|
||
|
"did": "538261193",
|
||
|
"siid": 2,
|
||
|
"piid": 1,
|
||
|
})
|
||
|
data = append(data, map[string]interface{}{
|
||
|
"did": "538261193",
|
||
|
"siid": 2,
|
||
|
"piid": 2,
|
||
|
})
|
||
|
data = append(data, map[string]interface{}{
|
||
|
"did": "538261193",
|
||
|
"siid": 2,
|
||
|
"piid": 3,
|
||
|
})
|
||
|
|
||
|
Mi.GetDeviceVar(data)
|
||
|
//Mi.Consumables(0)
|
||
|
//Mi.Scenes(0)
|
||
|
println(marshal)
|
||
|
fmt.Println(result)
|
||
|
}
|