Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { IsAvailable() bool GetState() (*State, error) GetID() ([]byte, error) GetFirmware() ([]byte, error) SetGrillTemp(temp int) error SetProbe1Target(temp int) error SetProbe2Target(temp int) error PowerOn() error PowerOnColdSmoke() error PowerOff() error }
Client - Green Mountain Grill client interface definition
type Command ¶
type Command string
Command -
const ( CommandGetInfo Command = "URCV!" CommandGetGrillID Command = "UL!" CommandGetGrillFirmware Command = "UN!" CommandSetGrillTemp Command = "UT%03d!" CommandSetProbe1Temp Command = "UF%03d!" CommandSetProbe2Temp Command = "Uf%03d!" CommandPowerOn Command = "UK001!" CommandPowerOnColdSmoke Command = "UK002!" CommandPowerOff Command = "UK004!" )
Commands that are accepted by the Green Mountain Grill
type FireState ¶
type FireState int
FireState -
const ( FireStateDefault FireState = iota FireStateOff FireStateStartup FireStateRunning FireStateCoolDown FireStateFail FireStateColdSmoke FireState = 198 )
FireState enum values
func FireStateString ¶
FireStateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func FireStateValues ¶
func FireStateValues() []FireState
FireStateValues returns all values of the enum
func (FireState) IsAFireState ¶
IsAFireState returns "true" if the value is listed in the enum definition. "false" otherwise
func (FireState) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for FireState
func (*FireState) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for FireState
type GrillUnreachableErr ¶
type GrillUnreachableErr struct {
// contains filtered or unexported fields
}
func (GrillUnreachableErr) Error ¶
func (g GrillUnreachableErr) Error() string
type Params ¶
type Params struct { GrillIP net.IP GrillPort int Logger *logrus.Logger ReadTimeout time.Duration // default 2 seconds WriteTimeout time.Duration // default 1 second MaxConnAttempts int // default 5 }
Params - Parameters to build a new Client
type PowerState ¶
type PowerState int
PowerState -
const ( PowerStateOff PowerState = iota PowerStateOn PowerStateFan PowerStateColdSmoke )
PowerState enum values
func PowerStateString ¶
func PowerStateString(s string) (PowerState, error)
PowerStateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func PowerStateValues ¶
func PowerStateValues() []PowerState
PowerStateValues returns all values of the enum
func (PowerState) IsAPowerState ¶
func (i PowerState) IsAPowerState() bool
IsAPowerState returns "true" if the value is listed in the enum definition. "false" otherwise
func (PowerState) MarshalJSON ¶
func (i PowerState) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for PowerState
func (*PowerState) Scan ¶
func (i *PowerState) Scan(value interface{}) error
func (PowerState) String ¶
func (i PowerState) String() string
func (*PowerState) UnmarshalJSON ¶
func (i *PowerState) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for PowerState
type State ¶
type State struct { CurrentTemperature int `json:"current_temperature"` TargetTemperature int `json:"target_temperature"` Probe1Temperature int `json:"probe1_temperature"` Probe1TargetTemperature int `json:"probe1_target_temperature"` Probe2Temperature int `json:"probe2_temperature"` Probe2TargetTemperature int `json:"probe2_target_temperature"` WarnCode WarnCode `json:"warn_code"` PowerState PowerState `json:"power_state"` FireState FireState `json:"fire_state"` }
State - The current state of the grill
func GetStateResponseToState ¶
GetStateResponseToState -
type WarnCode ¶
type WarnCode int
WarnCode -
const ( WarnCodeNone WarnCode = 0 WarnCodeFanMotorOverload WarnCode = 1 WarnCodeAugerMotorOverload WarnCode = 2 WarnCodeLowVoltage WarnCode = 4 WarnCodeIgniterOverload WarnCode = 8 WarnCodeLowPellet WarnCode = 128 )
WarnCode enum values TODO: VALIDATE, CURRENTLY NOT VALIDATED FOR ALL ERROR CODES
func WarnCodeString ¶
WarnCodeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func WarnCodeValues ¶
func WarnCodeValues() []WarnCode
WarnCodeValues returns all values of the enum
func (WarnCode) IsAWarnCode ¶
IsAWarnCode returns "true" if the value is listed in the enum definition. "false" otherwise
func (WarnCode) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for WarnCode
func (*WarnCode) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for WarnCode