Documentation ¶
Index ¶
- Variables
- func EncodePacket(pkt XPLPacket) string
- func ProcessMqtt(client mqtt.Client, msg mqtt.Message, srv *Server)
- func ProcessMqttDiscovery(c mqtt.Client, m mqtt.Message)
- func ProcessXPL(pkt *XPLPacket, mqtt *mqtt.Client)
- type HAConfig
- type HADevice
- type Server
- type Topic
- type XPLPacket
- type XPLType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidPacket = errors.New("invalid xpl packet")
View Source
var HADiscovery = make(map[string][]string)
View Source
var XPLPort = 3865
View Source
var XPLTypes = []XPLType{TypeCmnd, TypeStat, TypeTrig}
Functions ¶
func EncodePacket ¶
func ProcessMqttDiscovery ¶ added in v0.0.4
func ProcessXPL ¶
Types ¶
type HAConfig ¶
type HAConfig struct { Name string `json:"name,omitempty"` UniqueID string `json:"unique_id,omitempty"` DeviceClass string `json:"device_class,omitempty"` StateTopic string `json:"state_topic,omitempty"` Unit string `json:"unit_of_measurement,omitempty"` CommandTopic string `json:"command_topic,omitempty"` BrightnessScale int `json:"brightness_scale,omitempty"` BrightnessStateTopic string `json:"brightness_state_topic,omitempty"` BrightnessCommandTopic string `json:"brightness_command_topic,omitempty"` Icon string `json:"icon,omitempty"` Device HADevice `json:"device,omitempty"` SupportedFeatures []string `json:"supported_features,omitempty"` CodeArmRequired bool `json:"code_arm_required,omitempty"` CodeDisarmRequired bool `json:"code_disarm_required,omitempty"` CodeTriggerRequired bool `json:"code_trigger_required,omitempty"` }
type Topic ¶
type Topic struct { MessageType string DeviceType string DeviceID string DeviceParam string Action string }
xpl2mqtt/messagetype/device_type/device_id/device_parameter/action ex: xpl2mqtt/sensor.basic/th-1/0x12345678/temp/state
Click to show internal directories.
Click to hide internal directories.