Documentation ¶
Index ¶
- Constants
- func IOCommand(service *IOService, did string, text string, prefix string) (interface{}, error)
- func IOCommandHelp(did string, prefix string) string
- type AIService
- func (mnas *AIService) DeviceList(master int) (devices []DeviceData, err error)
- func (mnas *AIService) PlayByUrl(deviceId, url string) (map[string]interface{}, error)
- func (mnas *AIService) PlayerGetStatus(deviceId string) (*PlayerStatus, error)
- func (mnas *AIService) PlayerPause(deviceId string) (map[string]interface{}, error)
- func (mnas *AIService) PlayerPlay(deviceId string) (map[string]interface{}, error)
- func (mnas *AIService) PlayerSetVolume(deviceId string, volume int) (map[string]interface{}, error)
- func (mnas *AIService) Request(uri string, data url.Values, out any) error
- func (mnas *AIService) SendMessage(devices []map[string]interface{}, devno int, message string, volume *int) (bool, error)
- func (mnas *AIService) TextToSpeech(deviceId, text string) (map[string]interface{}, error)
- func (mnas *AIService) UbusRequest(deviceId, method, path string, message map[string]interface{}, res any) error
- type Account
- type DataCb
- type DeviceData
- type DeviceInfo
- type Devices
- type DummyTokenStore
- type FileTokenStore
- type IOService
- func (s *IOService) DeviceList(getVirtualModel bool, getHuamiDevices int) (devices []DeviceInfo, err error)
- func (s *IOService) HomeGetProp(did, prop string) (interface{}, error)
- func (s *IOService) HomeGetProps(did string, props []string) (map[string]interface{}, error)
- func (s *IOService) HomeRequest(did, method string, params interface{}) (map[string]interface{}, error)
- func (s *IOService) HomeSetProp(did, prop string, value interface{}) (int, error)
- func (s *IOService) HomeSetProps(did string, props map[string]interface{}) (map[string]int, error)
- func (s *IOService) IotDecode(ssecurity string, nonce string, data string, gzip bool) (interface{}, error)
- func (s *IOService) IotSpec(kind string) ([]string, error)
- func (s *IOService) MiotAction(did string, iid []int, args []interface{}) (int, error)
- func (s *IOService) MiotGetProp(did string, iid Iid) (interface{}, error)
- func (s *IOService) MiotGetProps(did string, iids []Iid) ([]interface{}, error)
- func (s *IOService) MiotRequest(cmd string, params interface{}) (map[string]interface{}, error)
- func (s *IOService) MiotSetProp(did string, iid Iid, value interface{}) (int, error)
- func (s *IOService) MiotSetProps(did string, props map[Iid]interface{}) ([]int, error)
- func (s *IOService) Request(uri string, data map[string]interface{}) (map[string]interface{}, error)
- type Iid
- type MiotSpecInstances
- type PlayerStatus
- type SidToken
- type TokenStore
- type Tokens
Constants ¶
View Source
const MIIO_SID = "xiaomiio"
View Source
const UA = "APP/com.xiaomi.mihome APPV/6.0.103 iosPassportSDK/3.9.0 iOS/14.4 miHSTS"
Variables ¶
This section is empty.
Functions ¶
func IOCommandHelp ¶
Types ¶
type AIService ¶
type AIService struct {
// contains filtered or unexported fields
}
func NewAIService ¶
func (*AIService) DeviceList ¶
func (mnas *AIService) DeviceList(master int) (devices []DeviceData, err error)
func (*AIService) PlayerGetStatus ¶
func (mnas *AIService) PlayerGetStatus(deviceId string) ( *PlayerStatus, error)
func (*AIService) PlayerPause ¶
func (*AIService) PlayerPlay ¶
func (*AIService) PlayerSetVolume ¶
func (*AIService) SendMessage ¶
func (*AIService) TextToSpeech ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func NewAccount ¶
func NewAccount(username string, password string, tokenStore TokenStore) *Account
func (*Account) NewRequest ¶
type DeviceData ¶
type DeviceData struct { DeviceID string `json:"deviceID"` SerialNumber string `json:"serialNumber"` Name string `json:"name"` Alias string `json:"alias"` Current bool `json:"current"` Presence string `json:"presence"` Address string `json:"address"` MiotDID string `json:"miotDID"` Hardware string `json:"hardware"` RomVersion string `json:"romVersion"` Capabilities struct { ChinaMobileIms int `json:"china_mobile_ims"` SchoolTimetable int `json:"school_timetable"` NightMode int `json:"night_mode"` UserNickName int `json:"user_nick_name"` PlayerPauseTimer int `json:"player_pause_timer"` DialogH5 int `json:"dialog_h5"` ChildMode2 int `json:"child_mode_2"` ReportTimes int `json:"report_times"` AlarmVolume int `json:"alarm_volume"` AiInstruction int `json:"ai_instruction"` ClassifiedAlarm int `json:"classified_alarm"` AiProtocol30 int `json:"ai_protocol_3_0"` NightModeDetail int `json:"night_mode_detail"` ChildMode int `json:"child_mode"` BabySchedule int `json:"baby_schedule"` ToneSetting int `json:"tone_setting"` Earthquake int `json:"earthquake"` AlarmRepeatOptionV2 int `json:"alarm_repeat_option_v2"` XiaomiVoip int `json:"xiaomi_voip"` NearbyWakeupCloud int `json:"nearby_wakeup_cloud"` FamilyVoice int `json:"family_voice"` BluetoothOptionV2 int `json:"bluetooth_option_v2"` Yunduantts int `json:"yunduantts"` MicoCurrent int `json:"mico_current"` VoipUsedTime int `json:"voip_used_time"` } `json:"capabilities"` RemoteCtrlType string `json:"remoteCtrlType"` DeviceSNProfile string `json:"deviceSNProfile"` DeviceProfile string `json:"deviceProfile"` BrokerEndpoint string `json:"brokerEndpoint"` BrokerIndex int `json:"brokerIndex"` Mac string `json:"mac"` Ssid string `json:"ssid"` }
type DeviceInfo ¶
type Devices ¶
type Devices struct { Code int `json:"code"` Message string `json:"message"` Data []DeviceData `json:"data"` }
type DummyTokenStore ¶
type DummyTokenStore struct {
// contains filtered or unexported fields
}
func (*DummyTokenStore) LoadToken ¶
func (d *DummyTokenStore) LoadToken() (*Tokens, error)
func (*DummyTokenStore) SaveToken ¶
func (d *DummyTokenStore) SaveToken(tokens *Tokens) error
type FileTokenStore ¶
type FileTokenStore struct {
// contains filtered or unexported fields
}
func NewTokenStore ¶
func NewTokenStore(tokenPath string) *FileTokenStore
func (*FileTokenStore) LoadToken ¶
func (mts *FileTokenStore) LoadToken() (*Tokens, error)
func (*FileTokenStore) SaveToken ¶
func (mts *FileTokenStore) SaveToken(tokens *Tokens) error
type IOService ¶
type IOService struct {
// contains filtered or unexported fields
}
func NewIOService ¶
func (*IOService) DeviceList ¶
func (s *IOService) DeviceList(getVirtualModel bool, getHuamiDevices int) (devices []DeviceInfo, err error)
func (*IOService) HomeGetProp ¶
func (*IOService) HomeGetProps ¶
func (*IOService) HomeRequest ¶
func (*IOService) HomeSetProp ¶
func (*IOService) HomeSetProps ¶
func (*IOService) MiotAction ¶
func (*IOService) MiotGetProp ¶
func (*IOService) MiotGetProps ¶
func (*IOService) MiotRequest ¶
func (*IOService) MiotSetProp ¶
func (*IOService) MiotSetProps ¶
type MiotSpecInstances ¶
type PlayerStatus ¶
type TokenStore ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.