mqtt

package
v0.0.0-...-a30ed0d Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSensorMode

func GetSensorMode(mode types.PortMode, controllerRepo repo.Controller) (class string, icon string)

func RegisterCommands

func RegisterCommands(profiluxMqtt *ProfiluxMqtt, mqttClient mqtt.Client, controllerRepo data.Controller, log logger.ILog, appConfig appSettings.Config)

Types

type Device

type Device struct {
	Identifiers  string `json:"identifiers"`
	Name         string `json:"name"`
	Model        string `json:"model"`
	Manufacturer string `json:"manufacturer"`
	Version      string `json:"hw_version"`
}

type HaBaseConfig

type HaBaseConfig struct {
	Device              Device `json:"device"`
	Name                string `json:"name"`
	UniqueId            string `json:"unique_id"`
	AvailabilityTopic   string `json:"availability_topic,omitempty"`
	DeviceClass         string `json:"device_class,omitempty"`
	PayloadAvailable    string `json:"payload_available"`
	PayloadNotAvailable string `json:"payload_not_available"`
	Icon                string `json:"icon,omitempty"`
	IconTemplate        string `json:"icon_template,omitempty"`
}

type HaButtonConfig

type HaButtonConfig struct {
	HaBaseConfig
	CommandTopic string `json:"command_topic"`
	StateTopic   string `json:"state_topic"`
}

type HaStateConfig

type HaStateConfig struct {
	HaBaseConfig
	StateTopic        string `json:"state_topic"`
	UnitOfMeasurement string `json:"unit_of_measurement,omitempty"`
}

type HaSwitchConfig

type HaSwitchConfig struct {
	HaBaseConfig
	StateTopic   string `json:"state_topic"`
	CommandTopic string `json:"command_topic"`
}

type ProfiluxMqtt

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

func (*ProfiluxMqtt) PublishMQTT

func (profiMqtt *ProfiluxMqtt) PublishMQTT(mqttClient mqtt.Client, log logger.ILog, topic string, payload string, forceUpdate bool)

func (*ProfiluxMqtt) PublishMQTTOld

func (profiMqtt *ProfiluxMqtt) PublishMQTTOld(mqttClient mqtt.Client, log logger.ILog, topic string)

func (*ProfiluxMqtt) UpdateHomeAssistant

func (profiMqtt *ProfiluxMqtt) UpdateHomeAssistant(controllerRepo repo.Controller, mqttClient mqtt.Client, log logger.ILog, forceUpdate bool)

func (*ProfiluxMqtt) UpdateMQTT

func (profiMqtt *ProfiluxMqtt) UpdateMQTT(controllerRepo repo.Controller, mqttClient mqtt.Client, log logger.ILog, forceUpdate bool)

Jump to

Keyboard shortcuts

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