vdevices

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToInterfaceList added in v0.3.7

func AddToInterfaceList(inFilePath, outFilePath, name, url, info string) error

Types

type AnalogInputChannel added in v0.3.3

type AnalogInputChannel struct {
	Channel

	// These callbacks are executed when an external system wants to change the
	// values. Only if the function returns true, the value is actually set.
	OnSetVoltage       func(value float64) (ok bool)
	OnSetVoltageStatus func(value int) (ok bool)
	// contains filtered or unexported fields
}

AnalogInputChannel implements a HM analog input channel (e.g. HmIP-MIO16-PCB:1).

func NewAnalogInputChannel added in v0.3.3

func NewAnalogInputChannel(device *Device) *AnalogInputChannel

NewAnalogInputChannel creates a new HM analog input channel and adds it to the device. The field OnSetVoltage must be set to be able to react to external value changes.

func (*AnalogInputChannel) SetVoltage added in v0.3.3

func (c *AnalogInputChannel) SetVoltage(value float64)

SetVoltage sets the voltage of the analog input.

func (*AnalogInputChannel) SetVoltageStatus added in v0.3.3

func (c *AnalogInputChannel) SetVoltageStatus(value int)

SetVoltageStatus sets the voltage status of the analog input.

func (*AnalogInputChannel) Voltage added in v0.3.3

func (c *AnalogInputChannel) Voltage() float64

Voltage returns the voltage of the analog input.

func (*AnalogInputChannel) VoltageStatus added in v0.3.3

func (c *AnalogInputChannel) VoltageStatus() int

VoltageStatus returns the voltage status of the analog input.

type BoolParameter

type BoolParameter struct {
	Parameter

	// This callback is executed when an external system wants to change the
	// value. Only if this function returns true, the value is actually set. The
	// device/channel is locked.
	OnSetValue func(value bool) (ok bool)
	// contains filtered or unexported fields
}

BoolParameter represents a HM BOOL or ACTION value.

func NewBoolParameter

func NewBoolParameter(id string) *BoolParameter

NewBoolParameter creates a BoolParameter (Type: BOOL). For an ACTION parameter Type must be modified accordingly. The locker of the channel is used while modifying the value. Following fields in the parameters description are initialized to standard values: Type, Operation, Flags, Default, Min, Max, ID.

func (*BoolParameter) InternalSetValue added in v0.4.0

func (p *BoolParameter) InternalSetValue(value interface{}) error

InternalSetValue implements ValueAccessor. The associated channel must be locked.

func (*BoolParameter) SetValue

func (p *BoolParameter) SetValue(value interface{}) error

SetValue implements interface GenericParameter. This accessor is for external systems. The associated channel must be locked.

func (*BoolParameter) Value

func (p *BoolParameter) Value() interface{}

Value implements interface GenericParameter. This accessor is for external systems. The associated channel must be locked.

type Channel

type Channel struct {
	sync.Mutex

	// Handler for dispose of channel (optional)
	OnDispose func()
	// contains filtered or unexported fields
}

Channel implements interface GenericChannel.

func (*Channel) AddMasterParam

func (c *Channel) AddMasterParam(parameter GenericParameter)

AddMasterParam adds a parameter to the MASTER paramset. OperationEvent is cleared. TabOrder is auto generated.

func (*Channel) AddValueParam

func (c *Channel) AddValueParam(parameter GenericParameter)

AddValueParam adds a parameter to the VALUES paramset.

func (*Channel) Description

func (c *Channel) Description() *itf.DeviceDescription

Description implements interface GenericChannel.

func (*Channel) Dispose

func (c *Channel) Dispose()

Dispose must be called, when the channel should free resources. Function OnDispose gets called, if specified.

func (*Channel) Init

func (c *Channel) Init(channelType string)

Init initializes Channel. This function must be called before any other member function.

func (*Channel) MasterParamset

func (c *Channel) MasterParamset() GenericParamset

MasterParamset implements interface GenericChannel.

func (*Channel) SetPublisher added in v0.4.0

func (c *Channel) SetPublisher(pub EventPublisher)

SetPublisher implements interface GenericChannel.

func (*Channel) ValueParamset

func (c *Channel) ValueParamset() GenericParamset

ValueParamset implements interface GenericChannel.

type Container

type Container struct {
	// Synchronizer updates the device lists in the logic layers.
	Synchronizer Synchronizer
	// contains filtered or unexported fields
}

A Container manages virtual devices and can be used by Handler. Devices can be added and removed at any time.

func NewContainer

func NewContainer() *Container

NewContainer creates a new device container.

func (*Container) AddDevice

func (c *Container) AddDevice(device GenericDevice) error

AddDevice adds the specified device to the container. The structure of a device, e.g. the channels and paramsets, must not change after adding the device.

func (*Container) Device

func (c *Container) Device(address string) (GenericDevice, error)

Device returns the device for the address.

func (*Container) Devices

func (c *Container) Devices() []GenericDevice

Devices returns all devices.

func (*Container) Dispose added in v0.3.5

func (c *Container) Dispose()

Dispose releases all devices and calls Dispose on them.

func (*Container) RemoveDevice

func (c *Container) RemoveDevice(address string) error

RemoveDevice removes the specified device from the container. If the device implements Disposer, Dispose gets called.

type Device

type Device struct {
	sync.Mutex

	// Handler for dispose of device (optional)
	OnDispose func()
	// contains filtered or unexported fields
}

Device is a generic container for channels and device master parameters. It implements interface GenericDevice. The structure of a device (channels and parameters) must not be changed after adding to the Container.

func NewDevice

func NewDevice(address, deviceType string, publisher EventPublisher) *Device

NewDevice creates a Device.

func (*Device) AddChannel added in v0.3.7

func (d *Device) AddChannel(channel GenericChannel)

AddChannel binds a channel to the device. Following fields in the channels description are initialized: Parent, ParentType, Address, Index. Publisher of the channel is set to the publisher of the device.

func (*Device) AddMasterParam

func (d *Device) AddMasterParam(parameter GenericParameter)

AddMasterParam adds a parameter to the master paramset.

func (*Device) Channel

func (d *Device) Channel(channelAddress string) (GenericChannel, error)

Channel implements interface GenericDevice.

func (*Device) Channels

func (d *Device) Channels() []GenericChannel

Channels implements interface GenericDevice.

func (*Device) Description

func (d *Device) Description() *itf.DeviceDescription

Description implements interface GenericDevice.

func (*Device) Dispose

func (d *Device) Dispose()

Dispose must be called, when the device should free resources. Function OnDispose gets called, if specified. Afterwards Dispose of each channel is invoked.

func (*Device) MasterParamset

func (d *Device) MasterParamset() GenericParamset

MasterParamset implements interface GenericDevice.

type DigitalChannel added in v0.4.3

type DigitalChannel struct {
	Channel

	// This callback is executed when an external system wants to change the
	// state. Only if this function returns true, the state is actually set.
	OnSetState func(value bool) (ok bool)
	// contains filtered or unexported fields
}

DigitalChannel implements a standard HM switch channel.

func NewDigitalChannel added in v0.4.3

func NewDigitalChannel(device *Device, channelType, control string) *DigitalChannel

NewDigitalChannel creates a new HM digital channel and adds it to the device. The field OnSetState must be set to be able to react to external value changes.

func NewDoorSensorChannel added in v0.4.3

func NewDoorSensorChannel(device *Device) *DigitalChannel

NewDoorSensorChannel creates a new HM door sensor channel and adds it to the device. The field OnSetState must be set to be able to react to external value changes.

func NewSwitchChannel

func NewSwitchChannel(device *Device) *DigitalChannel

NewSwitchChannel creates a new HM switch channel and adds it to the device. The field OnSetState must be set to be able to react to external value changes.

func (*DigitalChannel) SetState added in v0.4.3

func (c *DigitalChannel) SetState(value bool)

SetState sets the state of the switch.

func (*DigitalChannel) State added in v0.4.3

func (c *DigitalChannel) State() bool

State returns the state of the switch.

type DimmerChannel added in v0.4.6

type DimmerChannel struct {
	Channel

	// These callbacks are executed when an external system wants to change the
	// values. Only if the function returns true, the value is actually set.
	OnSetLevel    func(value float64) (ok bool)
	OnSetOldLevel func() (ok bool)
	OnSetRampTime func(value float64) (ok bool)
	OnSetOnTime   func(value float64) (ok bool)
	// contains filtered or unexported fields
}

DimmerChannel implements a HM dimmer channel (e.g. HM-LC-Dim1TPBU-FM:1).

func NewDimmerChannel added in v0.4.5

func NewDimmerChannel(device *Device) *DimmerChannel

NewDimmerChannel creates a new HM dimmer channel and adds it to the device.

func (*DimmerChannel) Level added in v0.4.6

func (c *DimmerChannel) Level() float64

Level returns the level of the dimmer.

func (*DimmerChannel) OnTime added in v0.4.6

func (c *DimmerChannel) OnTime() float64

OnTime returns the on time of the dimmer.

func (*DimmerChannel) RampTime added in v0.4.6

func (c *DimmerChannel) RampTime() float64

RampTime returns the ramp time of the dimmer.

func (*DimmerChannel) SetLevel added in v0.4.6

func (c *DimmerChannel) SetLevel(value float64)

SetLevel sets the level of the dimmer.

func (*DimmerChannel) SetOnTime added in v0.4.6

func (c *DimmerChannel) SetOnTime(value float64)

SetOnTime sets the on time of the dimmer.

func (*DimmerChannel) SetRampTime added in v0.4.6

func (c *DimmerChannel) SetRampTime(value float64)

SetRampTime sets the ramp time of the dimmer.

func (*DimmerChannel) SetWorking added in v0.4.6

func (c *DimmerChannel) SetWorking(value bool)

SetWorking sets working state of the dimmer.

func (*DimmerChannel) Working added in v0.4.6

func (c *DimmerChannel) Working() bool

Working returns the working state of the dimmer.

type EnergyCounterChannel added in v1.1.0

type EnergyCounterChannel struct {
	Channel

	// These callbacks are executed when an external system wants to change the
	// values. Only if the function returns true, the value is actually set.
	OnSetEnergyCounter func(value float64) (ok bool)
	OnSetPower         func(value float64) (ok bool)
	// contains filtered or unexported fields
}

EnergyCounterChannel implements a HM energy meter channel (e.g. HM-ES-TX-WM:1) of type POWERMETER_IEC1.

func NewEnergyCounterChannel added in v1.1.0

func NewEnergyCounterChannel(device *Device) *EnergyCounterChannel

NewEnergyCounterChannel creates a new HM energy meter channel and adds it to the device.

func (*EnergyCounterChannel) EnergyCounter added in v1.1.0

func (c *EnergyCounterChannel) EnergyCounter() float64

func (*EnergyCounterChannel) Power added in v1.1.0

func (c *EnergyCounterChannel) Power() float64

func (*EnergyCounterChannel) SetEnergyCounter added in v1.1.0

func (c *EnergyCounterChannel) SetEnergyCounter(value float64)

func (*EnergyCounterChannel) SetPower added in v1.1.0

func (c *EnergyCounterChannel) SetPower(value float64)

type EventPublisher

type EventPublisher interface {
	PublishEvent(address, valueKey string, value interface{})
}

EventPublisher publishes value change events.

type FloatParameter added in v0.3.3

type FloatParameter struct {
	Parameter

	// This callback is executed when an external system wants to change the
	// value. Only if this function returns true, the value is actually set. The
	// device/channel is locked.
	OnSetValue func(value float64) (ok bool)
	// contains filtered or unexported fields
}

FloatParameter represents a HM FLOAT value.

func NewFloatParameter added in v0.3.3

func NewFloatParameter(id string) *FloatParameter

NewFloatParameter creates a FloatParameter (Type: FLOAT). The locker of the channel is used while modifying the value. Following fields in the parameters description are initialized to standard values: Type, Operation, Flags, Default (0.0), Min (-100000), Max (100000), ID.

func (*FloatParameter) InternalSetValue added in v0.4.0

func (p *FloatParameter) InternalSetValue(value interface{}) error

InternalSetValue implements ValueAccessor. The associated channel must be locked.

func (*FloatParameter) SetValue added in v0.3.3

func (p *FloatParameter) SetValue(value interface{}) error

SetValue implements interface GenericParameter. This accessor is for external systems. The associated channel must be locked.

func (*FloatParameter) Value added in v0.3.3

func (p *FloatParameter) Value() interface{}

Value implements interface GenericParameter. This accessor is for external systems. The associated channel must be locked.

type GasCounterChannel added in v1.1.0

type GasCounterChannel struct {
	Channel

	// These callbacks are executed when an external system wants to change the
	// values. Only if the function returns true, the value is actually set.
	OnSetEnergyCounter func(value float64) (ok bool)
	OnSetPower         func(value float64) (ok bool)
	// contains filtered or unexported fields
}

GasCounterChannel implements a HM gas meter channel (e.g. HM-ES-TX-WM:1) of type POWERMETER_IEC1.

func NewGasCounterChannel added in v1.1.0

func NewGasCounterChannel(device *Device) *GasCounterChannel

NewGasCounterChannel creates a new HM gas meter channel and adds it to the device.

func (*GasCounterChannel) EnergyCounter added in v1.1.0

func (c *GasCounterChannel) EnergyCounter() float64

func (*GasCounterChannel) Power added in v1.1.0

func (c *GasCounterChannel) Power() float64

func (*GasCounterChannel) SetEnergyCounter added in v1.1.0

func (c *GasCounterChannel) SetEnergyCounter(value float64)

func (*GasCounterChannel) SetPower added in v1.1.0

func (c *GasCounterChannel) SetPower(value float64)

type GenericChannel

type GenericChannel interface {
	Description() *itf.DeviceDescription

	SetPublisher(publisher EventPublisher)

	AddMasterParam(GenericParameter)
	MasterParamset() GenericParamset

	AddValueParam(GenericParameter)
	ValueParamset() GenericParamset

	// The channel must be locked while reading or writing paramsets.
	sync.Locker

	Dispose()
}

GenericChannel that can be used by Handler.

type GenericDevice

type GenericDevice interface {
	Description() *itf.DeviceDescription

	Channels() []GenericChannel
	Channel(channelAddress string) (GenericChannel, error)

	AddMasterParam(GenericParameter)
	MasterParamset() GenericParamset

	// The device must be locked while reading or writing the master paramset.
	sync.Locker

	Dispose()
}

GenericDevice that can be used by Handler.

type GenericParameter

type GenericParameter interface {
	Description() *itf.ParameterDescription

	SetParentDescr(parentDescr *itf.DeviceDescription)
	SetPublisher(publisher EventPublisher)

	// Following methods must only be called with the channel locked.
	SetValue(value interface{}) error
	// no callbacks are executed and write access is not checked
	InternalSetValue(value interface{}) error
	Value() interface{}
}

GenericParameter that can be used by Handler.

type GenericParamset

type GenericParamset interface {
	Parameters() []GenericParameter
	Parameter(id string) (GenericParameter, error)
	Len() int

	// NotifyPutParamset is called after executing the RPC method putParamset.
	// The corresponding device or channel is locked while executed.
	NotifyPutParamset()

	// HandlePutParamset registers a handler for NotifyPutParamset.
	HandlePutParamset(func())
}

GenericParamset that can be used by Handler.

type Handler

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

Handler handles requests from logic layers.

func NewHandler

func NewHandler(ccuAddr string, devices *Container, deletionNotifier func(address string)) *Handler

NewHandler creates a Handler. deletionNotifier is called, when the CCU initiates a device deletion.

func (*Handler) Close

func (h *Handler) Close()

Close frees resources.

func (*Handler) Deinit

func (h *Handler) Deinit(receiverAddress string) error

Deinit implements DeviceLayer.

func (*Handler) DeleteDevice

func (h *Handler) DeleteDevice(address string, flags int) error

DeleteDevice implements DeviceLayer. Before removing the device from the container, deletionNotifier is called.

func (*Handler) GetDeviceDescription

func (h *Handler) GetDeviceDescription(address string) (*itf.DeviceDescription, error)

GetDeviceDescription implements DeviceLayer.

func (*Handler) GetParamset

func (h *Handler) GetParamset(address string, paramsetKey string) (map[string]interface{}, error)

GetParamset implements DeviceLayer.

func (*Handler) GetParamsetDescription

func (h *Handler) GetParamsetDescription(address, paramsetKey string) (itf.ParamsetDescription, error)

GetParamsetDescription implements DeviceLayer.

func (*Handler) GetValue

func (h *Handler) GetValue(address string, valueName string) (interface{}, error)

GetValue implements DeviceLayer.

func (*Handler) Init

func (h *Handler) Init(receiverAddress, interfaceID string) error

Init implements DeviceLayer.

func (*Handler) ListDevices

func (h *Handler) ListDevices() ([]*itf.DeviceDescription, error)

ListDevices implements DeviceLayer.

func (*Handler) Ping

func (h *Handler) Ping(callerID string) (bool, error)

Ping implements DeviceLayer.

func (*Handler) PublishEvent

func (h *Handler) PublishEvent(address, valueKey string, value interface{})

PublishEvent distributes an value event to all registered logic layers. Implements EventPublisher.

func (*Handler) PutParamset

func (h *Handler) PutParamset(address string, paramsetKey string, values map[string]interface{}) error

PutParamset implements DeviceLayer.

func (*Handler) SetValue

func (h *Handler) SetValue(address string, valueName string, value interface{}) error

SetValue implements DeviceLayer.

func (*Handler) Synchronize

func (h *Handler) Synchronize()

Synchronize updates the device lists in the logic layers. Implements Synchronizer.

type IntParameter added in v0.3.3

type IntParameter struct {
	Parameter

	// This callback is executed when an external system wants to change the
	// value. Only if this function returns true, the value is actually set. The
	// device/channel is locked.
	OnSetValue func(value int) (ok bool)
	// contains filtered or unexported fields
}

IntParameter represents a HM FLOAT value.

func NewIntParameter added in v0.3.3

func NewIntParameter(id string) *IntParameter

NewIntParameter creates an IntParameter (Type: INTEGER). For an ENUM parameter Type must be modified accordingly. The locker of the channel is used while modifying the value. Following fields in the parameters description are initialized to standard values: Type, Operation, Flags, Default (0), Min (-100000), Max (100000), ID.

func (*IntParameter) InternalSetValue added in v0.4.0

func (p *IntParameter) InternalSetValue(value interface{}) error

InternalSetValue implements ValueAccessor. The associated channel must be locked.

func (*IntParameter) SetValue added in v0.3.3

func (p *IntParameter) SetValue(value interface{}) error

SetValue implements interface GenericParameter. This accessor is for external systems. The associated channel must be locked.

func (*IntParameter) Value added in v0.3.3

func (p *IntParameter) Value() interface{}

Value implements interface GenericParameter. This accessor is for external systems. The associated channel must be locked.

type KeyChannel

type KeyChannel struct {
	Channel
	OnPressShort func() bool
	OnPressLong  func() bool
	// contains filtered or unexported fields
}

KeyChannel implements a standard HM key channel.

func NewKeyChannel

func NewKeyChannel(device *Device) *KeyChannel

NewKeyChannel creates a new HM key channel and adds it to the device.

func (*KeyChannel) PressLong

func (c *KeyChannel) PressLong()

PressShort sends a press long event.

func (*KeyChannel) PressShort

func (c *KeyChannel) PressShort()

PressShort sends a press short event.

type MaintenanceChannel

type MaintenanceChannel struct {
	Channel
	// contains filtered or unexported fields
}

MaintenanceChannel is a standard HM device maintenance channel. The first channel (Index: 0) of every HM device should be a maintenance channel.

func NewMaintenanceChannel

func NewMaintenanceChannel(device *Device) *MaintenanceChannel

NewMaintenanceChannel creates a new maintenance channel and adds it to the device.

func (*MaintenanceChannel) SetUnreach

func (c *MaintenanceChannel) SetUnreach(value bool)

SetUnreach sets the connection state of the device.

type Parameter

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

Parameter implements GenericParameter.

func (*Parameter) Description

func (p *Parameter) Description() *itf.ParameterDescription

Description implements interface GenericParameter.

func (*Parameter) SetParentDescr added in v0.4.0

func (p *Parameter) SetParentDescr(parentDescr *itf.DeviceDescription)

SetParentDescr implements interface GenericParameter.

func (*Parameter) SetPublisher added in v0.4.0

func (p *Parameter) SetPublisher(publisher EventPublisher)

SetPublisher implements interface GenericParameter.

type Paramset

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

Paramset implements GenericParamset.

func (*Paramset) Add

func (s *Paramset) Add(param GenericParameter)

Add adds a parameter to this parameter set.

func (*Paramset) HandlePutParamset added in v0.4.0

func (s *Paramset) HandlePutParamset(f func())

HandlePutParamset implements interface GenericParamset.

func (*Paramset) Len added in v0.4.7

func (s *Paramset) Len() int

Len implements interface GenericParamset.

func (*Paramset) NotifyPutParamset added in v0.4.0

func (s *Paramset) NotifyPutParamset()

NotifyPutParamset implements interface GenericParamset.

func (*Paramset) Parameter

func (s *Paramset) Parameter(id string) (GenericParameter, error)

Parameter implements interface GenericParamset.

func (*Paramset) Parameters

func (s *Paramset) Parameters() []GenericParameter

Parameters implements interface GenericParamset.

type PowerMeterChannel added in v1.0.0

type PowerMeterChannel struct {
	Channel

	// These callbacks are executed when an external system wants to change the
	// values. Only if the function returns true, the value is actually set.
	OnSetEnergyCounter func(value float64) (ok bool)
	OnSetPower         func(value float64) (ok bool)
	OnSetCurrent       func(value float64) (ok bool)
	OnSetVoltage       func(value float64) (ok bool)
	OnSetFrequency     func(value float64) (ok bool)
	// contains filtered or unexported fields
}

PowerMeterChannel implements a HM power meter channel (e.g. HM-ES-PMSw1-Pl:1).

func NewPowerMeterChannel added in v1.0.0

func NewPowerMeterChannel(device *Device) *PowerMeterChannel

NewPowerMeterChannel creates a new HM power meter channel and adds it to the device.

func (*PowerMeterChannel) Current added in v1.0.0

func (c *PowerMeterChannel) Current() float64

func (*PowerMeterChannel) EnergyCounter added in v1.0.0

func (c *PowerMeterChannel) EnergyCounter() float64

func (*PowerMeterChannel) Frequency added in v1.0.0

func (c *PowerMeterChannel) Frequency() float64

func (*PowerMeterChannel) Power added in v1.0.0

func (c *PowerMeterChannel) Power() float64

func (*PowerMeterChannel) SetCurrent added in v1.0.0

func (c *PowerMeterChannel) SetCurrent(value float64)

func (*PowerMeterChannel) SetEnergyCounter added in v1.0.0

func (c *PowerMeterChannel) SetEnergyCounter(value float64)

func (*PowerMeterChannel) SetFrequency added in v1.0.0

func (c *PowerMeterChannel) SetFrequency(value float64)

func (*PowerMeterChannel) SetPower added in v1.0.0

func (c *PowerMeterChannel) SetPower(value float64)

func (*PowerMeterChannel) SetVoltage added in v1.0.0

func (c *PowerMeterChannel) SetVoltage(value float64)

func (*PowerMeterChannel) Voltage added in v1.0.0

func (c *PowerMeterChannel) Voltage() float64

type StringParameter added in v0.3.4

type StringParameter struct {
	Parameter

	// This callback is executed when an external system wants to change the
	// value. Only if this function returns true, the value is actually set. The
	// device/channel is locked.
	OnSetValue func(value string) (ok bool)
	// contains filtered or unexported fields
}

StringParameter represents a HM STRING value.

func NewStringParameter added in v0.3.4

func NewStringParameter(id string) *StringParameter

NewStringParameter creates a StringParameter (Type: STRING). The locker of the channel is used while modifying the value. Following fields in the parameters description are initialized to standard values: Type, Operation, Flags, Default (""), Min (""), Max (""), ID.

func (*StringParameter) InternalSetValue added in v0.4.0

func (p *StringParameter) InternalSetValue(value interface{}) error

InternalSetValue implements ValueAccessor. The associated channel must be locked.

func (*StringParameter) SetValue added in v0.3.4

func (p *StringParameter) SetValue(value interface{}) error

SetValue implements interface GenericParameter. This accessor is for external systems. The associated channel must be locked.

func (*StringParameter) Value added in v0.3.4

func (p *StringParameter) Value() interface{}

Value implements interface GenericParameter. This accessor is for external systems. The associated channel must be locked.

type Synchronizer

type Synchronizer interface {
	Synchronize()
}

Synchronizer updates the device lists in the logic layers.

type TeeEventPublisher added in v0.3.2

type TeeEventPublisher struct {
	First  EventPublisher
	Second EventPublisher
}

TeeEventPublisher distributes a PublishEvent call to two receivers.

func (*TeeEventPublisher) PublishEvent added in v0.3.2

func (t *TeeEventPublisher) PublishEvent(address, valueKey string, value interface{})

PublishEvent implements vdevices.EventPublisher.

type TemperatureChannel added in v0.6.0

type TemperatureChannel struct {
	Channel

	// These callbacks are executed when an external system wants to change the
	// values. Only if the function returns true, the value is actually set.
	OnSetTemperature       func(value float64) (ok bool)
	OnSetTemperatureStatus func(value int) (ok bool)
	OnSetHumidity          func(value int) (ok bool)
	OnSetHumidityStatus    func(value int) (ok bool)
	// contains filtered or unexported fields
}

TemperatureChannel implements a HM temperature channel (e.g. HmIP-STHO:1).

func NewTemperatureChannel added in v0.6.0

func NewTemperatureChannel(device *Device) *TemperatureChannel

NewTemperatureChannel creates a new HM temperature channel and adds it to the device.

func (*TemperatureChannel) Humidity added in v0.6.0

func (c *TemperatureChannel) Humidity() int

Humidity returns the humidity of the sensor.

func (*TemperatureChannel) HumidityStatus added in v0.6.0

func (c *TemperatureChannel) HumidityStatus() int

HumidityStatus returns the humidity status of the sensor.

func (*TemperatureChannel) SetHumidity added in v0.6.0

func (c *TemperatureChannel) SetHumidity(value int)

SetHumidity sets the humidity of the sensor.

func (*TemperatureChannel) SetHumidityStatus added in v0.6.0

func (c *TemperatureChannel) SetHumidityStatus(value int)

SetHumidityStatus sets the temperature status of the sensor.

func (*TemperatureChannel) SetTemperature added in v0.6.0

func (c *TemperatureChannel) SetTemperature(value float64)

SetTemperature sets the temperature of the sensor.

func (*TemperatureChannel) SetTemperatureStatus added in v0.6.0

func (c *TemperatureChannel) SetTemperatureStatus(value int)

SetTemperatureStatus sets the temperature status of the sensor.

func (*TemperatureChannel) Temperature added in v0.6.0

func (c *TemperatureChannel) Temperature() float64

Temperature returns the temperature of the sensor.

func (*TemperatureChannel) TemperatureStatus added in v0.6.0

func (c *TemperatureChannel) TemperatureStatus() int

TemperatureStatus returns the temperature status of the sensor.

Jump to

Keyboard shortcuts

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