Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { Name string `yaml:"name"` // e.g. `open` or `close` Payload string `yaml:"payload"` // this could be the same or different than Name depending on the mqtt implementation TopicSuffix string `yaml:"topic_suffix"` // location where the command will be published; prefixed by MqttSettings.Topics.Prefix RequiredStartState string `yaml:"required_start_state"` // if set, garage door will not operate if current state does not equal this RequiredFinishState string `yaml:"required_finish_state"` // if set, garage door will monitor the door state compared to this value to determine success Timeout int `yaml:"timeout"` // time to wait for garage door to operate if monitored }
type MqttGdo ¶
type MqttGdo interface { // InitializeMqttClient initializes the client by setting the connection options, connecting // to the mqtt broker, and subscribing to topics InitializeMqttClient() // SetGarageDoor operates the garage door by publishing to the configured mqtt topic with the configured payload SetGarageDoor(string) error // process any required shutdown events, such as service disconnects ProcessShutdown() // contains filtered or unexported methods }
MqttGdo is the interface definition for an MqttGdo used by this library The interface is primarily used for mocking tests
func Initialize ¶
wrapper function to parse the config, initialize the connection to the mqtt broker, and return the MqttGdo object
func NewMqttGdo ¶
parses the config and returns an MqttGdo object
Click to show internal directories.
Click to hide internal directories.