Documentation ¶
Index ¶
- Constants
- type Chamber
- func (c *Chamber) Configure(configurator Configurator, service brewfather.Service, logger *logrus.Logger, ...) error
- func (c *Chamber) IsFermenting() bool
- func (c *Chamber) RefreshReadings()
- func (c *Chamber) StartFermentation(ctx context.Context, stepID string) error
- func (c *Chamber) StopFermentation() error
- type Configurator
- type Controller
- type DefaultConfigurator
- type DeviceConfig
- type Error
- type InvalidConfigurationError
- type Manager
- func (m *Manager) Delete(id string) error
- func (m *Manager) Get(id string) (*Chamber, error)
- func (m *Manager) GetAll() ([]*Chamber, error)
- func (m *Manager) Save(chamber *Chamber) error
- func (m *Manager) StartFermentation(ctx context.Context, chamberID string, step string) error
- func (m *Manager) StopFermentation(chamberID string) error
- type Readings
- type Repo
Constants ¶
View Source
const ( ErrNotFound = Error("chamber not found") ErrNoCurrentBatch = Error("chamber does not have a current batch") ErrInvalidStep = Error("invalid step") ErrNotFermenting = Error("fermentation has not started") ErrFermenting = Error("fermentation has started") ErrDeviceIsNil = Error("device is nil") ErrMetricsIsNil = Error("metrics provider nil") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chamber ¶
type Chamber struct { ID string `json:"id,omitempty"` Name string `json:"name"` DeviceConfig DeviceConfig `json:"deviceConfig"` ChillingDifferential float64 `json:"chillingDifferential"` HeatingDifferential float64 `json:"heatingDifferential"` CurrentBatch *batch.Detail `json:"currentBatch,omitempty"` CurrentFermentationStep string `json:"currentFermentationStep,omitempty"` ModTime time.Time `json:"modTime"` Readings *Readings `json:"readings,omitempty"` // contains filtered or unexported fields }
Chamber represents an insulated box (fridge) with internal heating/cooling elements that reacts to changes in monitored temperatures, by correcting small deviations from your desired fermentation temperature.
func (*Chamber) IsFermenting ¶
func (*Chamber) RefreshReadings ¶
func (c *Chamber) RefreshReadings()
func (*Chamber) StartFermentation ¶
StartFermentation signals the chamber to start the given fermentation step.
func (*Chamber) StopFermentation ¶
type Configurator ¶
type Controller ¶
type DefaultConfigurator ¶
func (*DefaultConfigurator) CreateDs18b20 ¶
func (c *DefaultConfigurator) CreateDs18b20(id string) (device.Thermometer, error)
func (*DefaultConfigurator) CreateGPIOActuator ¶
func (c *DefaultConfigurator) CreateGPIOActuator(pin string) (device.Actuator, error)
func (*DefaultConfigurator) CreateTilt ¶
func (c *DefaultConfigurator) CreateTilt(color tilt.Color) (device.ThermometerAndHydrometer, error)
type DeviceConfig ¶
type DeviceConfig struct { ChillerGPIO string `json:"chillerGpio"` HeaterGPIO string `json:"heaterGpio"` BeerThermometerType string `json:"beerThermometerType"` BeerThermometerID string `json:"beerThermometerId"` AuxiliaryThermometerType string `json:"auxiliaryThermometerType,omitempty"` AuxiliaryThermometerID string `json:"auxiliaryThermometerId,omitempty"` ExternalThermometerType string `json:"externalThermometerType,omitempty"` ExternalThermometerID string `json:"externalThermometerId,omitempty"` HydrometerType string `json:"hydrometerType,omitempty"` HydrometerID string `json:"hydrometerId,omitempty"` }
type InvalidConfigurationError ¶
type InvalidConfigurationError struct {
// contains filtered or unexported fields
}
func (InvalidConfigurationError) Error ¶
func (e InvalidConfigurationError) Error() string
func (InvalidConfigurationError) Problems ¶
func (e InvalidConfigurationError) Problems() []error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) StartFermentation ¶
StartFermentation signals the given chamber to start the given fermentation step.
func (*Manager) StopFermentation ¶
Click to show internal directories.
Click to hide internal directories.