brew

package
v0.0.0-...-bbd3cca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CancelErr = "cancel"

CancelErr error if process not finish correctly

Variables

This section is empty.

Functions

This section is empty.

Types

type Control

type Control interface {
	On() error
	Off() error
	State() bool
}

Control interface to turn off and on and get a state of the control unit

type DS18B20

type DS18B20 struct {
	Name string
	Path string
}

DS18B20 temperatur sensor with 1-wire protocol

func DS18B20Reg

func DS18B20Reg(address string) (*DS18B20, error)

DS18B20Reg register a valid Path for DS18B20 and return a DS18B20 struct

func (*DS18B20) Get

func (ds *DS18B20) Get() (float64, error)

Get data from DS18B20

type External

type External struct {
	Cmd string
	// contains filtered or unexported fields
}

External implements a external programm to control. no args, fix

func (*External) Off

func (e *External) Off() error

Off executes the given external programm with args no output

func (*External) On

func (e *External) On() error

On executes the given external programm with args no output

func (*External) State

func (e *External) State() bool

State returns the current state of external cmd

type Kettle

type Kettle struct {
	Temp     TempSensor
	Heater   Control
	Agitator Control
	// contains filtered or unexported fields
}

Kettle is the pod unit with Temp, Heater and Agitator

func (*Kettle) Metric

func (k *Kettle) Metric() KettleMetric

Metric returns current Metrics from Kettle

func (*Kettle) Off

func (k *Kettle) Off()

Off turns the Agitator and the Heater of if available

func (*Kettle) On

func (k *Kettle) On()

On turns the Agitator and the Heater on if available

func (*Kettle) TempCompare

func (k *Kettle) TempCompare(last float64, temp float64) bool

TempCompare checks the temp and sate of the kettle

func (*Kettle) TempHold

func (k *Kettle) TempHold(stop chan struct{}, tempTo float64, timeout time.Duration) error

TempHold control the Heater to hold a given temperature. You can set a duration or 0 (unlimited) Its a blocking function which you can stop with the stop channel

func (*Kettle) TempSet

func (k *Kettle) TempSet(temp float64) (current float64, err error)

TempSet check the state of the Heater and turn off/on related to the given temp

func (*Kettle) TempUp

func (k *Kettle) TempUp(stop chan struct{}, tempTo float64) error

TempUp control the Heater to increase to a given temperature Its a blocking function which you can stop with the stop channel

type KettleMetric

type KettleMetric struct {
	Temp     float64
	Heater   bool
	Agitator bool
	Fail     int
}

KettleMetric for access internal Metrics from outside

type SSR

type SSR struct {
	Pin gpio.PinIO
}

SSR struct with gpio pin for a SSR relay

func SSRReg

func SSRReg(address string) (*SSR, error)

SSRReg register a valid gpio address and return a SSR struct

func (*SSR) Off

func (ssr *SSR) Off() error

Off turn ssr off

func (*SSR) On

func (ssr *SSR) On() error

On turn ssr on

func (*SSR) State

func (ssr *SSR) State() bool

State returns the current state of ssr

type SSRDummy

type SSRDummy struct {
	// contains filtered or unexported fields
}

SSRDummy is a dummy SSR relay

func (*SSRDummy) Off

func (d *SSRDummy) Off() error

Off set state of the dummy to false

func (*SSRDummy) On

func (d *SSRDummy) On() error

On set state of the dummy to true

func (*SSRDummy) State

func (d *SSRDummy) State() bool

State get the current state of dummy

type Signal

type Signal struct {
	Pin  uint
	Code uint64
	// contains filtered or unexported fields
}

Signal implements control over a gpio pin via 433MHZ signals

func (*Signal) Off

func (s *Signal) Off() error

Off send off code over the given gpio pin (on code - 1 )

func (*Signal) On

func (s *Signal) On() error

On send on code over the given gpio pin

func (*Signal) State

func (s *Signal) State() bool

State returns the current state of gpio

type TempDummy

type TempDummy struct {
	Name string
	Temp float64
	Fn   func() bool
}

TempDummy struct is a dummy sensor that gives you values for dev and testing

func (*TempDummy) Get

func (td *TempDummy) Get() (float64, error)

Get data from Dummy

type TempSensor

type TempSensor interface {
	Get() (float64, error)
}

TempSensor interface to Get() data from sensor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL