Documentation
¶
Overview ¶
Package wifire implements a client for connecting to the Traeger REST and MQTT APIs. The goal is to support temperature monitoring with a potential longterm goal of controlling the grill.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Logger func(level LogLevel, component string, message string)
Logger is the package global logging handler.
Functions ¶
func ClientID ¶
ClientID is an option setting function for New(). It sets the client identifier for the WiFire API. This should be set to the ID of the Traeger App.
func Credentials ¶
Credentials is an option setting function for New(). It sets the user and password credentials for logging into the API. These are the same values used by the Traeger App.
Types ¶
type Grill ¶
type Grill struct {
// contains filtered or unexported fields
}
Grill is a handle for a grills MQTT connection.
func (Grill) Disconnect ¶
func (g Grill) Disconnect()
Disconnect closed the MQTT connection to the Grill.
func (Grill) SubscribeStatus ¶
SubscribeStatus subscribes to the prod/thing/update for the grill. SubscribeStatus updates are pushed to the returned channel.
type LogLevel ¶
type LogLevel int
LogLevel is the log level for MQTT calls.
const ( // LogError maps to mqtt.ERROR and mqtt.CRITICAL. LogError LogLevel // LogWarn maps to mqtt.WARN. LogWarn // LogInfo does not have a mqtt level. LogInfo // LogDebug maps to mqtt.DEBUG. LogDebug )
type Plotter ¶ added in v0.6.0
type Plotter struct {
// contains filtered or unexported fields
}
Plotter creates a graph of the wifire Status data.
func NewPlotter ¶ added in v0.6.0
func NewPlotter(o PlotterOptions) *Plotter
NewPlotter returns a Plotter configured with the options o. If o is empty the default settings are used.
type PlotterOptions ¶ added in v0.6.0
type PlotterOptions struct { Title string Period Period AmbientColor color.Color AmbientFillColor color.Color ProbeColor color.Color GrillColor color.Color MarkerColor color.Color Data []Status Markers []time.Duration }
PlotterOptions is used to configure the Plotter.
type Status ¶
type Status struct { Error error `json:"error,omitempty"` Ambient int `json:"ambient"` Connected bool `json:"connected"` Grill int `json:"grill"` GrillSet int `json:"grill_set"` KeepWarm int `json:"keep_warm,omitempty"` PelletLevel int `json:"pellet_level,omitempty"` Probe int `json:"probe,omitempty"` ProbeAlarmFired bool `json:"probe_alarm_fired,omitempty"` ProbeConnected bool `json:"probe_connected,omitempty"` ProbeSet int `json:"probe_set,omitempty"` RealTime int `json:"real_time,omitempty"` Smoke int `json:"smoke,omitempty"` Time time.Time `json:"time"` Units int `json:"units"` }
Status is the grill status returned from the MQTT subscription. If there was an error receiving the message the Error field is set.