types

package
v0.0.0-...-d6813a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string
const (
	Register Action = "register"
	Date     Action = "date"
	Query    Action = "query"
	Update   Action = "update"
)

type Device

type Device struct {
	DeviceId   string `json:"deviceid"`
	ApiKey     string `json:"apikey"`
	Version    int    `json:"version"`
	RomVersion string `json:"romVersion"`
	Model      string `json:"model"`

	// the state of the switch as "on" or "off"
	State string `json:"state"`
}

type Message

type Message struct {
	Action     Action `json:"action"`
	DeviceId   string `json:"deviceid"`
	UserAgent  string `json:"userAgent"`
	ApiKey     string `json:"apikey"`
	Version    int    `json:"version"`
	RomVersion string `json:"romVersion"`
	Model      string `json:"model"`
	Ts         int64  `json:"ts"`
}

type QueryMessage

type QueryMessage struct {
	Message
	Params []string `json:"params"`
}

type UpdateMessage

type UpdateMessage struct {
	Message
	Params   UpdateParams `json:"params"`
	Sequence string       `json:"sequence"`
}

type UpdateParams

type UpdateParams struct {
	Switch string `json:"switch"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL