Documentation ¶
Index ¶
- Constants
- type ButtonEvent
- type DeconzDevice
- func (e *DeconzDevice) CreateButtonDevice(sensor deconzsensor.Sensor, buttonId int)
- func (e *DeconzDevice) NewDeconzDevice(vdcdClient *vdcdapi.Client, deconzHost string, deconzPort int, ...) *vdcdapi.Device
- func (e *DeconzDevice) NewDeconzGroupDevice() *vdcdapi.Device
- func (e *DeconzDevice) NewDeconzLightDevice() *vdcdapi.Device
- func (e *DeconzDevice) NewDeconzSensorDevice() *vdcdapi.Device
- func (e *DeconzDevice) SetBrightness(brightness float32)
- func (e *DeconzDevice) SetColorTemp(ct float32)
- func (e *DeconzDevice) SetHue(hue float32)
- func (e *DeconzDevice) SetSaturation(saturation float32)
- func (e *DeconzDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)
- func (e *DeconzDevice) StartDiscovery(vdcdClient *vdcdapi.Client, deconzHost string, deconzPort int, ...)
- func (e *DeconzDevice) TurnOff()
- func (e *DeconzDevice) TurnOn()
- func (e *DeconzDevice) ZHASwitchSensorDiscovery(sensor deconzsensor.Sensor)
- type DeconzLightAttribute
- type DeconzState
- type DeconzWebSocketMessage
- type GenericDevice
- type ShellyDevice
- func (e *ShellyDevice) NewShellyDevice(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client) *vdcdapi.Device
- func (e *ShellyDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)
- func (e *ShellyDevice) StartDiscovery(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client)
- func (e *ShellyDevice) TurnOff()
- func (e *ShellyDevice) TurnOn()
- type TasmotaDevice
- func (e *TasmotaDevice) NewTasmotaDevice(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client) *vdcdapi.Device
- func (e *TasmotaDevice) SetBrightness(brightness float32)
- func (e *TasmotaDevice) SetColorTemp(ct float32)
- func (e *TasmotaDevice) SetHSB(hue float32, saturation float32, brightness float32)
- func (e *TasmotaDevice) SetHue(hue float32)
- func (e *TasmotaDevice) SetSaturation(saturation float32)
- func (e *TasmotaDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)
- func (e *TasmotaDevice) SetWhite(white float32)
- func (e *TasmotaDevice) StartDiscovery(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client)
- func (e *TasmotaDevice) TurnOff()
- func (e *TasmotaDevice) TurnOn()
- type TasmotaResultMsg
- type TasmotaTeleMsg
- type TasmotaTeleSI721Msg
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 (*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 (*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 (*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 (*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 ¶
Click to show internal directories.
Click to hide internal directories.