mqtt

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	ClientID string `yaml:"client_id"`
}

type Client

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

func NewClient

func NewClient(broker *Broker) (*Client, error)

func (*Client) Client

func (c *Client) Client() mqtt.Client

func (*Client) Publish

func (c *Client) Publish(topic string, data []byte)

type HomeAssistant

type HomeAssistant struct {
	Enabled       bool          `yaml:"enabled"`
	DiscoveryBase string        `yaml:"discovery_base"`
	Interval      time.Duration `yaml:"interval"`
}

type MQTT

type MQTT struct {
	Enabled       bool          `yaml:"enabled"`
	Broker        *Broker       `yaml:"broker"`
	Topic         Topic         `yaml:"topic"`
	Client        *Client       `yaml:"-"`
	HomeAssistant HomeAssistant `yaml:"homeassistant"`
}

type Topic

type Topic string

func (*Topic) Name

func (t *Topic) Name(name string) string

Jump to

Keyboard shortcuts

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