Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GardenAction ¶
type GardenAction struct {
Light *LightAction `json:"light" form:"light"`
Stop *StopAction `json:"stop" form:"stop"`
Update *UpdateAction `json:"update" form:"update"`
}
GardenAction collects all the possible actions for a Garden into a single struct so these can easily be received as one request
type LightAction ¶
type LightAction struct {
State pkg.LightState `json:"state" form:"state"`
}
LightAction is an action for turning on or off a light for the Garden. The State field is optional and it will just toggle the current state if left empty.
type StopAction ¶
type StopAction struct {
All bool `json:"all" form:"all"`
}
StopAction is an action for stopping watering of a Zone. It doesn't stop watering a specific Zone, only what is currently watering and optionally clearing the queue of Zones to water.
type UpdateAction ¶
type UpdateAction struct {
Config bool `json:"config" form:"config"`
}
Update action is used to send the Garden's current ControllerConfig to the the controller
type WaterAction ¶
type WaterAction struct {
Duration *pkg.Duration `json:"duration" form:"duration"`
IgnoreWeather bool `json:"ignore_weather"`
// Source is only used internally and is not set by incoming commands
Source Source `json:"-"`
}
WaterAction is an action for watering a Zone for the specified amount of time
type WaterMessage ¶
type WaterMessage struct {
Duration int64 `json:"duration"`
ZoneID string `json:"zone_id"`
Position uint `json:"position"`
EventID string `json:"id"`
Source Source `json:"source"`
// Start is a boolean showing if this record is the start or finish event. It is excluded
// from JSON because it is just used when parsing incoming messages that log the start/finish
Start bool `json:"-"`
}
WaterMessage is the message being sent over MQTT to the embedded garden controller
type ZoneAction ¶
type ZoneAction struct {
Water *WaterAction `json:"water" form:"water"`
}
ZoneAction collects all the possible actions for a Zone into a single struct so these can easily be received as one request