models

package
v0.0.0-...-8d6f0fd Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2017 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown               ProductType = 0x0000
	GELinkBulb                        = 0xce3d
	GoControlSwitch                   = 0x0102
	GoControlMotionSensor             = 0x0203
	GoControlSiren                    = 0x0503
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDevice

type BaseDevice interface {
	Id() int
	Interconnect() string
	Username() string
}

type Device

type Device struct {
	Id           int    `json: "id"`
	Interconnect string `json: "interconnect"`
	Username     string `json: "username"`
}

type LED

type LED struct {
	Red   int `json: "red"`
	Green int `json: "green"`
	Blue  int `json: "blue"`
}

type Light

type Light struct {
	Device
	Value              int  `json: "value"`
	Active             bool `json: "active"`
	CountDownInSeconds int  `json: "countDownInSeconds"`
}

type MotionSensor

type MotionSensor struct {
	Device
	Sensor
	Temperature float64 `json: "temperature"`
	TempUnit    string  `json: "tempUnit"`
	Armed       bool    `json: "armed"`
}

type ProductType

type ProductType int64

type Products

type Products struct {
	Lights        []Light
	Switches      []Switch
	MotionSensors []MotionSensor
	Sirens        []Siren
}

type Response

type Response struct {
	Status int    `json: "status"`
	Result string `json: "result"`
	Error  string `json: "active"`
}

func (*Response) Log

func (r *Response) Log()

func (*Response) Respond

func (r *Response) Respond(w http.ResponseWriter)

type Sensor

type Sensor struct {
	Device
	BatteryLevel int  `json: "batteryLevel"`
	OnOff        bool `json: "onOff"`
}

type Siren

type Siren struct {
	Device
	Sensor
}

type Switch

type Switch struct {
	Device
	Sensor
	Armed bool `json: "armed"`
}

Jump to

Keyboard shortcuts

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