mqttclient

package
v0.0.0-...-2aa9fcf Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorBrokerConnectionRefused = errors.New("Bronker Error: Connection refused")
View Source
var ItemQueue []QueueItem

Functions

func AddToQueue

func AddToQueue(client mqtt.Client, msg mqtt.Message, handler func(mqtt.Client, mqtt.Message))

func Blind

func Blind(client mqtt.Client, msg mqtt.Message)

func Command

func Command(client mqtt.Client, msg mqtt.Message)

func Dimmer

func Dimmer(client mqtt.Client, msg mqtt.Message)

func GetMQTTClientConnection

func GetMQTTClientConnection() mqtt.Client

func HandleMQTTQueue

func HandleMQTTQueue()

func HandleQueue

func HandleQueue()

func ParseMessage

func ParseMessage(msg mqtt.Message) (deviceid int64, state int, level int, x int64, y int64, color_temp int, err error)

func Restart

func Restart()

func SendTopic

func SendTopic(topic string, payload []byte, retained bool) error

func SetHex

func SetHex(client mqtt.Client, msg mqtt.Message)

func Start

func Start(wg *sync.WaitGroup, status_channel chan (error))

func State

func State(client mqtt.Client, msg mqtt.Message)

func Stop

func Stop()

func Subscribe

func Subscribe(client mqtt.Client, status_channel chan (error))

Types

type MQTTQueueItem

type MQTTQueueItem struct {
	Topic    string
	Payload  []byte
	Retained bool
}

type MQTTStateMessage

type MQTTStateMessage struct {
	Color struct {
		X float64 `json:"x"`
		Y float64 `json:"y"`
	} `json:"color"`
	State      string `json:"state"`
	Brightness int    `json:"brightness"`
	ColorTemp  int    `json:"color_temp"`
	Position   int    `json:"position"`
}

type MQTTStatePayload

type MQTTStatePayload struct {
	State string
}

type MQTTboolPayload

type MQTTboolPayload struct {
	Value string
}

type MQTTgwConfig

type MQTTgwConfig struct {
	Ip  string
	Key string
}

type MQTTpayload

type MQTTpayload struct {
	Value int64
}

type MQTTstatus

type MQTTstatus struct {
	Status string
	Error  string
}

type QueueItem

type QueueItem struct {
	Client  mqtt.Client
	Message mqtt.Message
	Handler func(mqtt.Client, mqtt.Message)
	Retries int
}

Jump to

Keyboard shortcuts

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