discovery

package
v0.0.0-...-42ab871 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// milisecs
	SingleTip   int = 150
	SingleClick int = 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ButtonEvent

type ButtonEvent int
const (
	Hold ButtonEvent = iota + 1
	ShortRelease
	LongRelease
	DoublePress
	TreeplePress
)

http://developer.digitalstrom.org/Architecture/ds-basics.pdf

type DeconzDevice

type DeconzDevice struct {
	GenericDevice

	IsLight bool

	IsGroup bool

	IsSensor bool
	// contains filtered or unexported fields
}

func (*DeconzDevice) CreateButtonDevice

func (e *DeconzDevice) CreateButtonDevice(sensor deconzsensor.Sensor, buttonId int)

func (*DeconzDevice) NewDeconzDevice

func (e *DeconzDevice) NewDeconzDevice(vdcdClient *vdcdapi.Client, deconzHost string, deconzPort int, deconzWebSocketPort int, deconzAPI string) *vdcdapi.Device

func (*DeconzDevice) NewDeconzGroupDevice

func (e *DeconzDevice) NewDeconzGroupDevice() *vdcdapi.Device

func (*DeconzDevice) NewDeconzLightDevice

func (e *DeconzDevice) NewDeconzLightDevice() *vdcdapi.Device

func (*DeconzDevice) NewDeconzSensorDevice

func (e *DeconzDevice) NewDeconzSensorDevice() *vdcdapi.Device

func (*DeconzDevice) SetBrightness

func (e *DeconzDevice) SetBrightness(brightness float32)

func (*DeconzDevice) SetColorTemp

func (e *DeconzDevice) SetColorTemp(ct float32)

func (*DeconzDevice) SetHue

func (e *DeconzDevice) SetHue(hue float32)

func (*DeconzDevice) SetSaturation

func (e *DeconzDevice) SetSaturation(saturation float32)

func (*DeconzDevice) SetValue

func (e *DeconzDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)

Apply update from dss to deconz device

func (*DeconzDevice) StartDiscovery

func (e *DeconzDevice) StartDiscovery(vdcdClient *vdcdapi.Client, deconzHost string, deconzPort int, deconcWebSockerPort int, deconzAPI string, enableGroups bool)

func (*DeconzDevice) TurnOff

func (e *DeconzDevice) TurnOff()

func (*DeconzDevice) TurnOn

func (e *DeconzDevice) TurnOn()

func (*DeconzDevice) ZHASwitchSensorDiscovery

func (e *DeconzDevice) ZHASwitchSensorDiscovery(sensor deconzsensor.Sensor)

type DeconzLightAttribute

type DeconzLightAttribute struct {
	Id                string `json:"id,omitempty"`
	LastAnnounced     string `json:"lastannounced,omitempty"`
	LastSeen          string `json:"lastseen,omitempty"`
	ManufacturerName  string `json:"manufacturername,omitempty"`
	ModelId           string `json:"modelid,omitempty"`
	Name              string `json:"name,omitempty"`
	SWVersion         string `json:"swversion,omitempty"`
	Type              string `json:"type,omitempty"`
	UniqueID          string `json:"uniqueid,omitempty"`
	ColorCapabilities int    `json:"colorcapabilities,omitempty"`
	Ctmax             int    `json:"ctmax,omitempty"`
	Ctmin             int    `json:"ctmin,omitempty"`
}

type DeconzState

type DeconzState struct {

	// Light & Group
	On     *bool     `json:"on,omitempty"`     //
	Hue    *uint16   `json:"hue,omitempty"`    //
	Effect string    `json:"effect,omitempty"` //
	Bri    *uint8    `json:"bri,omitempty"`    // min = 1, max = 254
	Sat    *uint8    `json:"sat,omitempty"`    //
	CT     *uint16   `json:"ct,omitempty"`     // min = 154, max = 500
	XY     []float32 `json:"xy,omitempty"`
	Alert  string    `json:"alert,omitempty"`

	// Light
	Reachable      *bool   `json:"reachable,omitempty"`
	ColorMode      string  `json:"colormode,omitempty"`
	ColorLoopSpeed *uint8  `json:"colorloopspeed,omitempty"`
	TransitionTime *uint16 `json:"transitiontime,omitempty"`

	// Group
	AllOn bool `json:"all_on,omitempty"`
	AnyOn bool `json:"any_on,omitempty"`

	// Sensor
	ButtonEvent int `json:"buttonevent,omitempty"`
}

type DeconzWebSocketMessage

type DeconzWebSocketMessage struct {
	Type       string               `json:"t,omitempty"`
	Event      string               `json:"e,omitempty"`
	Resource   string               `json:"r,omitempty"`
	ID         string               `json:"id,omitempty"`
	UniqueID   string               `json:"uniqueid,omitempty"`
	GroupID    string               `json:"gid,omitempty"`
	SceneID    string               `json:"scid,omitempty"`
	Name       string               `json:"name,omitempty"`
	Attributes DeconzLightAttribute `json:"attr,omitempty"`
	State      DeconzState          `json:"state,omitempty"`
}

type GenericDevice

type GenericDevice struct {
	// contains filtered or unexported fields
}

type ShellyDevice

type ShellyDevice struct {
	GenericDevice
	Id                   string `json:"id,omitempty"`
	Model                string `json:"model,omitempty"`
	MACAddress           string `json:"mac,omitempty"`
	IPAddress            string `json:"ip,omitempty"`
	NewFirewareAvailable bool   `json:"new_fw,omitempty"`
	FirmewareVersion     string `json:"fw_ver,omitempty"`
}

func (*ShellyDevice) NewShellyDevice

func (e *ShellyDevice) NewShellyDevice(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client) *vdcdapi.Device

func (*ShellyDevice) SetValue

func (e *ShellyDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)

Apply update from dss to shelly

func (*ShellyDevice) StartDiscovery

func (e *ShellyDevice) StartDiscovery(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client)

func (*ShellyDevice) TurnOff

func (e *ShellyDevice) TurnOff()

func (*ShellyDevice) TurnOn

func (e *ShellyDevice) TurnOn()

type TasmotaDevice

type TasmotaDevice struct {
	GenericDevice
	IPAddress       string         `json:"ip,omitempty"`
	DeviceName      string         `json:"dn,omitempty"`
	FriendlyName    []string       `json:"fn,omitempty"`
	Hostname        string         `json:"hn,omitempty"`
	MACAddress      string         `json:"mac,omitempty"`
	Module          string         `json:"md,omitempty"`
	TuyaMCUFlag     int            `json:"ty,omitempty"`
	IFAN            int            `json:"if,omitempty"`
	DOffline        string         `json:"ofln,omitempty"`
	DOnline         string         `json:"onln,omitempty"`
	State           []string       `json:"st,omitempty"`
	SoftwareVersion string         `json:"sw,omitempty"`
	Topic           string         `json:"t,omitempty"`
	Fulltopic       string         `json:"ft,omitempty"`
	TopicPrefix     []string       `json:"tp,omitempty"`
	Relays          []int          `json:"rl,omitempty"`
	Switches        []int          `json:"swc,omitempty"`
	SWN             []int          `json:"swn,omitempty"`
	Buttons         []int          `json:"btn,omitempty"`
	SetOptions      map[string]int `json:"so,omitempty"`
	LK              int            `json:"lk,omitempty"`    // LightColor (LC) and RGB LinKed https://github.com/arendst/Tasmota/blob/development/tasmota/xdrv_04_light.ino#L689
	LightSubtype    int            `json:"lt_st,omitempty"` // https://github.com/arendst/Tasmota/blob/development/tasmota/xdrv_04_light.ino
	ShutterOptions  []int          `json:"sho,omitempty"`
	Version         int            `json:"ver,omitempty"`
}

func (*TasmotaDevice) NewTasmotaDevice

func (e *TasmotaDevice) NewTasmotaDevice(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client) *vdcdapi.Device

func (*TasmotaDevice) SetBrightness

func (e *TasmotaDevice) SetBrightness(brightness float32)

func (*TasmotaDevice) SetColorTemp

func (e *TasmotaDevice) SetColorTemp(ct float32)

func (*TasmotaDevice) SetHSB

func (e *TasmotaDevice) SetHSB(hue float32, saturation float32, brightness float32)

func (*TasmotaDevice) SetHue

func (e *TasmotaDevice) SetHue(hue float32)

func (*TasmotaDevice) SetSaturation

func (e *TasmotaDevice) SetSaturation(saturation float32)

func (*TasmotaDevice) SetValue

func (e *TasmotaDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)

Apply update from dss to shelly

func (*TasmotaDevice) SetWhite

func (e *TasmotaDevice) SetWhite(white float32)

func (*TasmotaDevice) StartDiscovery

func (e *TasmotaDevice) StartDiscovery(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client)

func (*TasmotaDevice) TurnOff

func (e *TasmotaDevice) TurnOff()

func (*TasmotaDevice) TurnOn

func (e *TasmotaDevice) TurnOn()

type TasmotaResultMsg

type TasmotaResultMsg struct {
	Power1   string `json:"POWER1,omitempty"`
	Power    string `json:"POWER,omitempty"`
	Dimmer   int    `json:"Dimmer,omitempty"`
	Color    string `json:"Color,omitempty"`
	HSBCOlor string `json:"HSBColor,omitempty"`
	White    int    `json:"White,omitempty"`
	Channel  []int  `json:"Channel,omitempty"`
}

type TasmotaTeleMsg

type TasmotaTeleMsg struct {
	Time     string              `json:"time,omitempty"`
	TempUnit string              `json:"TempUnit,omitempty"`
	SI7021   TasmotaTeleSI721Msg `json:"SI7021,omitempty"`
}

type TasmotaTeleSI721Msg

type TasmotaTeleSI721Msg struct {
	Temperature float32 `json:"Temperature,omitempty"`
	Humidity    float32 `json:"Humidity,omitempty"`
	DewPoint    float32 `json:"DewPoint,omitempty"`
}

Jump to

Keyboard shortcuts

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