events

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MqttPublisher

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

func NewMqttPublisher

func NewMqttPublisher(client mqtt.Client) *MqttPublisher

func (*MqttPublisher) Publish

func (m *MqttPublisher) Publish(topic Topic, payload []byte) error

func (*MqttPublisher) PublishAsString

func (m *MqttPublisher) PublishAsString(topic Topic, payload fmt.Stringer) error

type OHGateway

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

func NewOHGateway

func NewOHGateway(publisher Publisher, opts ...Option) *OHGateway

func (*OHGateway) Close

func (o *OHGateway) Close() error

func (*OHGateway) Start

func (o *OHGateway) Start()

type Option

type Option func(o *OHGateway)

func WithDeviceDiscover

func WithDeviceDiscover(d oh2mqtt.DevicesDiscover) Option

func WithIntervalPublish

func WithIntervalPublish(interval time.Duration) Option

func WithTopicFormat

func WithTopicFormat(topicFormat string) Option

type Publisher

type Publisher interface {
	Publish(topic Topic, payload []byte) error
	PublishAsString(topic Topic, payload fmt.Stringer) error
}

type StatePublisher

type StatePublisher struct{}

func (*StatePublisher) Close

func (s *StatePublisher) Close() error

func (*StatePublisher) Run

func (s *StatePublisher) Run() error

type Topic

type Topic string

type TopicFormatter

type TopicFormatter string

func (TopicFormatter) Apply

func (t TopicFormatter) Apply(room string, topic string) Topic

Jump to

Keyboard shortcuts

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