mqtt

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigAddress     = "address"
	ConfigUsername    = "username"
	ConfigPassword    = "password"
	ConfigLabel       = "label"
	ConfigPath        = "path"
	ConfigInputTopic  = "inputTopic"
	ConfigOutputTopic = "outputTopic"
	ConfigOnPayload   = "onPayload"
	ConfigOffPayload  = "offPayload"
	ConfigMode        = "mode"
)
View Source
const (
	ConnectionType   = "mqtt"
	TuneButtonType   = "mqtt.AT100Tune"
	SwitchButtonType = "mqtt.Switch"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AliveListener

type AliveListener interface {
	SetAlive(path string, alive bool)
}

type Client

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

func NewClient

func NewClient(address string, username string, password string) *Client

func (*Client) AddPath

func (c *Client) AddPath(path string)

func (*Client) Connected

func (c *Client) Connected() bool

func (*Client) Disconnect

func (c *Client) Disconnect()

func (*Client) Notify

func (c *Client) Notify(listener interface{})

func (*Client) Publish

func (c *Client) Publish(topic string, payload string)

func (*Client) SetAlive

func (c *Client) SetAlive(path string, alive bool)

func (*Client) SetSWR

func (c *Client) SetSWR(path string, swr float64)

func (*Client) SetTX

func (c *Client) SetTX(path string, tx bool)

func (*Client) SetTune

func (c *Client) SetTune(path string, tuning bool)

func (*Client) Subscribe

func (c *Client) Subscribe(s Subscriber, topics ...string)

func (*Client) Tune

func (c *Client) Tune(path string)

type Factory

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

func NewButtonFactory

func NewButtonFactory(provider hamdeck.ConnectionConfigProvider, legacyAddress string, username string, password string) *Factory

func (*Factory) Close

func (f *Factory) Close()

func (*Factory) CreateButton

func (f *Factory) CreateButton(config map[string]interface{}) hamdeck.Button

type SWRListener

type SWRListener interface {
	SetSWR(path string, swr float64)
}

type Subscriber

type Subscriber interface {
	SetInput(topic string, payload string)
}

type SwitchButton

type SwitchButton struct {
	hamdeck.BaseButton
	// contains filtered or unexported fields
}

func NewSwitchButton

func NewSwitchButton(client *Client, label string, inputTopic, outputTopic, onPayload, offPayload string, mode SwitchMode) *SwitchButton

func (*SwitchButton) Enable

func (b *SwitchButton) Enable(enabled bool)

func (*SwitchButton) Image

func (b *SwitchButton) Image(gc hamdeck.GraphicContext, redrawImages bool) image.Image

func (*SwitchButton) Pressed

func (b *SwitchButton) Pressed()

func (*SwitchButton) Released

func (b *SwitchButton) Released()

func (*SwitchButton) SetInput

func (b *SwitchButton) SetInput(topic string, payload string)

type SwitchMode

type SwitchMode string
const (
	SwitchModeOn     SwitchMode = "ON"
	SwitchModeOff    SwitchMode = "OFF"
	SwitchModeToggle SwitchMode = "TOGGLE"
)

type TXListener

type TXListener interface {
	SetTX(path string, tx bool)
}

type TuneButton

type TuneButton struct {
	hamdeck.BaseButton
	// contains filtered or unexported fields
}

func NewTuneButton

func NewTuneButton(atu100Client *Client, label string, path string) *TuneButton

func (*TuneButton) Enable

func (b *TuneButton) Enable(enabled bool)

func (*TuneButton) Image

func (b *TuneButton) Image(gc hamdeck.GraphicContext, redrawImages bool) image.Image

func (*TuneButton) Pressed

func (b *TuneButton) Pressed()

func (*TuneButton) Released

func (b *TuneButton) Released()

func (*TuneButton) SetAlive

func (b *TuneButton) SetAlive(path string, alive bool)

func (*TuneButton) SetSWR

func (b *TuneButton) SetSWR(path string, swr float64)

func (*TuneButton) SetTX

func (b *TuneButton) SetTX(path string, tx bool)

func (*TuneButton) SetTune

func (b *TuneButton) SetTune(path string, tuning bool)

type TuneListener

type TuneListener interface {
	SetTune(path string, tuning bool)
}

Jump to

Keyboard shortcuts

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