Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidEvent = errors.New("invalid event") ErrEventNotFound = errors.New("event not found") )
View Source
var DataDir string
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { SensorsByName map[string]sensor.Sensor SensorsByID map[string]sensor.Sensor Zones map[string]*Zone }
func New ¶
func New() *Controller
func (*Controller) AddZone ¶
func (c *Controller) AddZone(z *Zone)
type Event ¶
type Event struct { Time units.TimeOfDay `json:"time"` Action Action `json:"action"` ThermAction *ThermostatAction `json:"therm_action,omitempty"` }
func (Event) NextOccurance ¶
type EventHandler ¶
type EventHandler interface { AddEvent(Event) error ReplaceEvent(units.TimeOfDay, Event) error RemoveEvent(units.TimeOfDay) error FindEvent(units.TimeOfDay) (Event, bool) ReadEvents() []Event NextEvent() *Event Boost(time.Duration) CancelBoost() Boosted() bool }
func NewEventHandler ¶
func NewEventHandler(s scheduler.Scheduler, demand func(Event)) EventHandler
type ThermostatAction ¶
type ThermostatAction struct { Action Action `json:"action"` Param units.Temperature `json:"param"` }
func (ThermostatAction) Apply ¶
func (ta ThermostatAction) Apply(t thermostat.Thermostat)
func (ThermostatAction) String ¶
func (ta ThermostatAction) String() string
type Zone ¶
type Zone struct { ID string Scheduler scheduler.Scheduler Thermostat thermostat.Thermostat EventHandler // contains filtered or unexported fields }
func (*Zone) SetupThermostat ¶
func (z *Zone) SetupThermostat(source sensor.Sensor, initialTarget units.Temperature)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.