mqtt

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorItem

type ActorItem struct {
	Item
}

ActorItem groups multiple MQTT values that can be modified

func (*ActorItem) SetValues

func (i *ActorItem) SetValues(values map[string]interface{}) error

SetValues of item

type Broker

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

Broker handles the connection to an MQTT broker

func NewBroker

func NewBroker(address, username, password string) (*Broker, error)

NewBroker creates a new broker connection

func (*Broker) Close

func (b *Broker) Close()

Close connection to broker

func (*Broker) Publish

func (b *Broker) Publish(topic, value string) error

Publish sends message to topic

func (*Broker) Subscribe

func (b *Broker) Subscribe(value *Value) error

Subscribe value topic

func (*Broker) Unsubscribe

func (b *Broker) Unsubscribe(value *Value)

Unsubscribe value topic

type Item

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

Item groups multiple MQTT values

func (*Item) Events

func (i *Item) Events() map[string]api.SimpleHandler

Events returns all events that can be emitted

func (*Item) GetValueTypes

func (i *Item) GetValueTypes() api.FieldMap

GetValueTypes of item

func (*Item) GetValues

func (i *Item) GetValues() map[string]interface{}

GetValues of item

func (*Item) ID

func (i *Item) ID() string

ID of item

func (*Item) Name

func (i *Item) Name() string

Name of item

func (*Item) SetEventTrigger

func (i *Item) SetEventTrigger(trigger func(action string, data map[string]interface{}))

SetEventTrigger for item event

type Plugin

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

Plugin that implements interface to MQTT broker

func (*Plugin) Config

func (p *Plugin) Config() *core.PluginConfigDef

Config returns the definition of the config interface

func (*Plugin) ID

func (p *Plugin) ID() string

ID of plugin

func (*Plugin) Init

func (p *Plugin) Init(b core.Bus) error

Init plugin

func (*Plugin) Shutdown

func (p *Plugin) Shutdown()

Shutdown called if plugin should be stopped

func (*Plugin) Version

func (p *Plugin) Version() string

Version information of plugin

type Value

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

Value based on MQTT topic

Jump to

Keyboard shortcuts

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