Documentation
¶
Index ¶
- Constants
- Variables
- func CountryToXMPPServer(country string) string
- func DecodePublicKey() (*rsa.PublicKey, error)
- func Encrypt(key *rsa.PublicKey, data string) (string, error)
- func MD5String(data string) string
- func SortedKeys(params url.Values) []string
- func SortedQuery(params url.Values) string
- type AccessToken
- type AuthCode
- type DeviceState
- type DevicesResponse
- type Ecovacs
- type EcovacsEvent
- func (this *EcovacsEvent) Device() home.EvovacsDevice
- func (this *EcovacsEvent) Id() string
- func (*EcovacsEvent) NS() gopi.EventNS
- func (*EcovacsEvent) Name() string
- func (this *EcovacsEvent) Source() gopi.Unit
- func (this *EcovacsEvent) String() string
- func (this *EcovacsEvent) Type() home.EcovacsEventType
- func (this *EcovacsEvent) Value() interface{}
- type LoginResponse
- type RequestId
- type Response
- type UserResponse
- type XMPPClient
- func (this *XMPPClient) Address() string
- func (this *XMPPClient) Charge() (string, error)
- func (this *XMPPClient) Clean(mode home.EcovacsCleanMode, suction home.EcovacsCleanSuction) (string, error)
- func (this *XMPPClient) Close() error
- func (this *XMPPClient) GetBatteryInfo() (string, error)
- func (this *XMPPClient) GetChargeState() (string, error)
- func (this *XMPPClient) GetCleanState() (string, error)
- func (this *XMPPClient) GetLifeSpan(part home.EcovacsPart) (string, error)
- func (this *XMPPClient) GetVersion() (string, error)
- func (this *XMPPClient) IsConnected() bool
- func (this *XMPPClient) NewClient(opts xmpp.Options, deviceId, class string) error
- func (this *XMPPClient) Ping() error
- func (this *XMPPClient) Recv() (*XMPPMessage, error)
- type XMPPMessage
- func (this *XMPPMessage) BatteryLevel() uint
- func (this *XMPPMessage) ChargeState() string
- func (this *XMPPMessage) CleanState() (home.EcovacsCleanMode, home.EcovacsCleanSuction)
- func (this *XMPPMessage) Equals(other *XMPPMessage) bool
- func (this *XMPPMessage) Error() (uint, string)
- func (this *XMPPMessage) ErrorMsg() string
- func (this *XMPPMessage) Id() string
- func (this *XMPPMessage) LifeSpan() (home.EcovacsPart, uint, uint)
- func (this *XMPPMessage) String() string
- func (this *XMPPMessage) Type() home.EcovacsEventType
- func (this *XMPPMessage) Value() interface{}
- func (this *XMPPMessage) Version() string
Constants ¶
View Source
const ( // https://github.com/wpietri/sucks/blob/master/sucks/__init__.py CLIENT_KEY = "eJUWrzRv34qFSaYk" SECRET = "Cyu5jcR4zyK6QEPn1hdIGXB5QIDAQABMA0GC" PUBLIC_KEY = `` /* 271-byte string literal not displayed */ )
View Source
const ( // Time-to-live for any state DELTA_OTHER_TTL = 4 * time.Minute DELTA_VERSION_TTL = 6 * time.Hour DELTA_LIFESPAN_TTL = 2 * time.Hour )
View Source
const ( MAIN_URL_FORMAT = "" /* 155-byte string literal not displayed */ USER_URL_FORMAT = "https://users-{{.continent}}.ecouser.net:8000/user.do" ECOVACS_REALM = "ecouser.net" ECOVACS_XMPP_PORT = 5223 )
Variables ¶
View Source
var (
COUNTRY_ALPHA2_TO_CONTINENT_CODE = map[string]string{}/* 245 elements not displayed */
)
View Source
var (
ServerMap = map[string]string{
"msg.ecouser.net": "CH",
"msg-as.ecouser.net": "TW,MY,JP,SG,TH,HK,IN,KR",
"msg-na.ecouser.net": "US",
"msg-eu.ecouser.net": "FR,ES,UK,NO,MX,DE,PT,CH,AU,IT,NL,SE,BE,DK",
"msg-ww.ecouser.net": "",
}
)
Functions ¶
func CountryToXMPPServer ¶
CountryToXMPPServer returns hostname for countrycode
func DecodePublicKey ¶
func SortedKeys ¶
func SortedQuery ¶
Types ¶
type AccessToken ¶
type DeviceState ¶
func (*DeviceState) AddExpiredKey ¶
func (this *DeviceState) AddExpiredKey(key home.EcovacsEventType)
func (*DeviceState) NextExpiredKey ¶
func (this *DeviceState) NextExpiredKey() home.EcovacsEventType
func (*DeviceState) Set ¶
func (this *DeviceState) Set(value *XMPPMessage, ttl time.Duration) bool
Sets a value for key, and returns true if value was added or modified
func (*DeviceState) String ¶
func (this *DeviceState) String() string
type DevicesResponse ¶
type DevicesResponse struct {
UserResponse
Devices []*device `json:"devices"`
}
type EcovacsEvent ¶
type EcovacsEvent struct {
// contains filtered or unexported fields
}
func NewEvent ¶
func NewEvent(source home.Ecovacs, device home.EvovacsDevice, message *XMPPMessage) *EcovacsEvent
func (*EcovacsEvent) Device ¶
func (this *EcovacsEvent) Device() home.EvovacsDevice
func (*EcovacsEvent) Id ¶
func (this *EcovacsEvent) Id() string
func (*EcovacsEvent) NS ¶
func (*EcovacsEvent) NS() gopi.EventNS
func (*EcovacsEvent) Name ¶
func (*EcovacsEvent) Name() string
func (*EcovacsEvent) Source ¶
func (this *EcovacsEvent) Source() gopi.Unit
func (*EcovacsEvent) String ¶
func (this *EcovacsEvent) String() string
func (*EcovacsEvent) Type ¶
func (this *EcovacsEvent) Type() home.EcovacsEventType
func (*EcovacsEvent) Value ¶
func (this *EcovacsEvent) Value() interface{}
type LoginResponse ¶
type LoginResponse struct {
UserResponse
UserId string `json:"userId"`
Resource string `json:"resource"`
Token string `json:"token"`
Last uint `json:"last"`
}
type UserResponse ¶
type XMPPClient ¶
func (*XMPPClient) Address ¶
func (this *XMPPClient) Address() string
func (*XMPPClient) Charge ¶
func (this *XMPPClient) Charge() (string, error)
func (*XMPPClient) Clean ¶
func (this *XMPPClient) Clean(mode home.EcovacsCleanMode, suction home.EcovacsCleanSuction) (string, error)
func (*XMPPClient) Close ¶
func (this *XMPPClient) Close() error
func (*XMPPClient) GetBatteryInfo ¶
func (this *XMPPClient) GetBatteryInfo() (string, error)
func (*XMPPClient) GetChargeState ¶
func (this *XMPPClient) GetChargeState() (string, error)
func (*XMPPClient) GetCleanState ¶
func (this *XMPPClient) GetCleanState() (string, error)
func (*XMPPClient) GetLifeSpan ¶
func (this *XMPPClient) GetLifeSpan(part home.EcovacsPart) (string, error)
func (*XMPPClient) GetVersion ¶
func (this *XMPPClient) GetVersion() (string, error)
func (*XMPPClient) IsConnected ¶
func (this *XMPPClient) IsConnected() bool
func (*XMPPClient) NewClient ¶
func (this *XMPPClient) NewClient(opts xmpp.Options, deviceId, class string) error
func (*XMPPClient) Ping ¶
func (this *XMPPClient) Ping() error
func (*XMPPClient) Recv ¶
func (this *XMPPClient) Recv() (*XMPPMessage, error)
type XMPPMessage ¶
type XMPPMessage struct {
XMLName xml.Name `xml:"query"`
// Data structure
Control struct {
Id string `xml:"id,attr"`
Ret string `xml:"ret,attr"`
ErrorNo uint `xml:"errno,attr"`
Error string `xml:"error,attr"`
Type string `xml:"type,attr"`
Val uint `xml:"val,attr"`
Total uint `xml:"total,attr"`
Battery struct {
Power uint `xml:"power,attr"`
} `xml:"battery"`
Charge struct {
Type string `xml:"type,attr"`
} `xml:"charge"`
Clean struct {
Type string `xml:"type,attr"`
Speed string `xml:"speed,attr"`
} `xml:"clean"`
Version struct {
Name string `xml:"name,attr"`
Value string `xml:",chardata"`
} `xml:"ver"`
} `xml:"ctl"`
// contains filtered or unexported fields
}
XMPPMessage encapsulates all the message information which can be returned from DeeBot
func NewXMPPMessage ¶
func NewXMPPMessage(data []byte, id string) (*XMPPMessage, error)
NewXMPPMessage creates a new message
func (*XMPPMessage) BatteryLevel ¶
func (this *XMPPMessage) BatteryLevel() uint
func (*XMPPMessage) ChargeState ¶
func (this *XMPPMessage) ChargeState() string
func (*XMPPMessage) CleanState ¶
func (this *XMPPMessage) CleanState() (home.EcovacsCleanMode, home.EcovacsCleanSuction)
func (*XMPPMessage) Equals ¶
func (this *XMPPMessage) Equals(other *XMPPMessage) bool
func (*XMPPMessage) Error ¶
func (this *XMPPMessage) Error() (uint, string)
func (*XMPPMessage) ErrorMsg ¶
func (this *XMPPMessage) ErrorMsg() string
func (*XMPPMessage) LifeSpan ¶
func (this *XMPPMessage) LifeSpan() (home.EcovacsPart, uint, uint)
func (*XMPPMessage) String ¶
func (this *XMPPMessage) String() string
func (*XMPPMessage) Type ¶
func (this *XMPPMessage) Type() home.EcovacsEventType
Type returns the type of message which the message represents
func (*XMPPMessage) Value ¶
func (this *XMPPMessage) Value() interface{}
Value returns the information contained within the message
func (*XMPPMessage) Version ¶
func (this *XMPPMessage) Version() string
Click to show internal directories.
Click to hide internal directories.