connector

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

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

func New

func New(config configuration.Config, ctx context.Context) (result *Connector, err error)

func (*Connector) CommandHandler

func (this *Connector) CommandHandler(deviceId string, serviceId string, command mgw.Command)

expects ids from mgw (with prefixes and suffixes)

func (*Connector) DeviceInfoListener

func (this *Connector) DeviceInfoListener(nodes []model.DeviceInfo, huskIds []int64, withValues bool, allKnownDevices bool)

func (*Connector) NotifyRefresh

func (this *Connector) NotifyRefresh()

func (*Connector) SetDeviceState

func (this *Connector) SetDeviceState(nodeId int64, online bool) error

func (*Connector) ValueEventListener

func (this *Connector) ValueEventListener(nodeValue model.Value)

type DeviceRepo

type DeviceRepo interface {
	FindDeviceTypeId(device model.DeviceInfo) (dtId string, usedFallback bool, err error)
	CreateDeviceTypeWithDistinctAttributes(key string, dt models.DeviceType, attributeKeys []string) (result models.DeviceType, code int, err error)
}

type ValueWithTimestamp

type ValueWithTimestamp struct {
	Value      interface{} `json:"value"`
	LastUpdate int64       `json:"lastUpdate"`
}

type Z2mClient

type Z2mClient interface {
	SetErrorForwardingFunc(clientError func(message string))
	SetValueEventListener(listener func(nodeValue model.Value))
	SetDeviceInfoListener(listener func(nodes []model.DeviceInfo, huskIds []int64, withValues bool, allKnownDevices bool))
	RequestDeviceInfoUpdate() error
	SetValueByValueId(id string, value interface{}) error
	SetDeviceStatusListener(state func(nodeId int64, online bool) error)
}

Jump to

Keyboard shortcuts

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