homie

package
v0.0.0-...-4351fdd Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromSourceConfig

func NewFromSourceConfig(g config.Generic) (s api.Source, err error)

NewFromSourceConfig creates Homie/MQTT data source

Types

type Property

type Property string
const (
	State      Property = "$state" // device
	StateReady Property = "ready"
	StateLost  Property = "lost"
	Properties Property = "$properties" // node
	Name       Property = "$name"       // property
	Unit       Property = "$unit"
	DataType   Property = "$datatype"
)

type PropertySet

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

PropertySet provides common operations on list of properties

func NewPropertySet

func NewPropertySet(props ...string) *PropertySet

NewPropertySet creates PropertySet

func (*PropertySet) Add

func (p *PropertySet) Add(s string) bool

Add adds an entry to the set

func (*PropertySet) All

func (p *PropertySet) All() []string

All returns all properties of the set

func (*PropertySet) Contains

func (p *PropertySet) Contains(s string) bool

Contains checks if match is contained in the list

func (*PropertySet) Get

func (p *PropertySet) Get(s string) interface{}

Get returns property by name

func (*PropertySet) Match

func (p *PropertySet) Match(s string) []string

Match returns all properties starting with match

func (*PropertySet) Remove

func (p *PropertySet) Remove(s string) bool

Remove removes an entry from the set

type Subscriber

type Subscriber struct {
	*mq.Connector
	// contains filtered or unexported fields
}

Subscriber Homie/MQTT data source

func NewSubscriber

func NewSubscriber(name string, rootTopic string, mqttOptions *mqtt.ClientOptions) *Subscriber

NewSubscriber creates Homie/MQTT data source

func (*Subscriber) Run

func (h *Subscriber) Run(out chan api.Data)

Run implements api.Source

Jump to

Keyboard shortcuts

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