Documentation ¶
Index ¶
- Constants
- func NewMeteredInput(input Input) *meteredInput
- func NewMeteredOutput(output Output) *meteredOutput
- type CacheInput
- type DummyOutput
- type DummyTempSensor
- type GPIOOutput
- type Haltable
- type Input
- type OneWireTemperatureInput
- type OrOutput
- type OrOutputMember
- type Output
- type OutputDistributor
- type Servo
- type TimerOutput
Constants ¶
View Source
const InputError = math.MaxFloat32
InputError represents that the value is currently not available from the device
Variables ¶
This section is empty.
Functions ¶
func NewMeteredInput ¶
func NewMeteredInput(input Input) *meteredInput
func NewMeteredOutput ¶
func NewMeteredOutput(output Output) *meteredOutput
Types ¶
type CacheInput ¶
type CacheInput struct {
// contains filtered or unexported fields
}
func NewCacheInput ¶
func (*CacheInput) Degree ¶
func (i *CacheInput) Degree() string
func (*CacheInput) Name ¶
func (i *CacheInput) Name() string
func (*CacheInput) Type ¶
func (i *CacheInput) Type() string
func (*CacheInput) Value ¶
func (i *CacheInput) Value() float64
type DummyOutput ¶
func (*DummyOutput) Get ¶
func (d *DummyOutput) Get() bool
func (*DummyOutput) Name ¶
func (d *DummyOutput) Name() string
func (*DummyOutput) Set ¶
func (d *DummyOutput) Set(value bool) bool
type DummyTempSensor ¶
type DummyTempSensor struct {
Temperature float64
}
func (*DummyTempSensor) Degree ¶
func (s *DummyTempSensor) Degree() string
func (*DummyTempSensor) Name ¶
func (s *DummyTempSensor) Name() string
func (*DummyTempSensor) Type ¶
func (s *DummyTempSensor) Type() string
func (*DummyTempSensor) Value ¶
func (s *DummyTempSensor) Value() float64
type GPIOOutput ¶
type GPIOOutput struct {
// contains filtered or unexported fields
}
func NewGPIOOutput ¶
func NewGPIOOutput(name, pin string, activeLow bool) *GPIOOutput
func (*GPIOOutput) Get ¶
func (d *GPIOOutput) Get() bool
func (*GPIOOutput) Halt ¶
func (d *GPIOOutput) Halt()
func (*GPIOOutput) Name ¶
func (g *GPIOOutput) Name() string
func (*GPIOOutput) Set ¶
func (g *GPIOOutput) Set(newState bool) bool
type Haltable ¶
type Haltable interface {
//Halt shuts down the device as appropriate. At least it shall Set() the device into the idle state.
Halt()
}
Haltable is an interface which is expected to be implemented by outputs which need careful cleanup on system shutdown
type Input ¶
type Input interface { //Name tells the human readable name of the input Name() string //Type tells the human readable type / nature of the input (i.e. "Temperature") Type() string //Degree tells the human readable degree of the input (i.e. "°C") Degree() string //Value tells the actual up-to-date value of the measured indicator Value() float64 }
Input represents any measurable property as a floating point number
type OneWireTemperatureInput ¶
type OneWireTemperatureInput struct {
// contains filtered or unexported fields
}
func NewOneWireTemperatureInput ¶
func NewOneWireTemperatureInput(name, deviceId string) *OneWireTemperatureInput
func (*OneWireTemperatureInput) Degree ¶
func (o *OneWireTemperatureInput) Degree() string
func (*OneWireTemperatureInput) Name ¶
func (o *OneWireTemperatureInput) Name() string
func (*OneWireTemperatureInput) Type ¶
func (o *OneWireTemperatureInput) Type() string
func (*OneWireTemperatureInput) Value ¶
func (o *OneWireTemperatureInput) Value() float64
type OrOutputMember ¶
type OrOutputMember struct {
// contains filtered or unexported fields
}
func NewOrOutput ¶
func NewOrOutput(name string, realOutput Output, amount int) []OrOutputMember
func (*OrOutputMember) Get ¶
func (o *OrOutputMember) Get() bool
func (*OrOutputMember) Name ¶
func (o *OrOutputMember) Name() string
func (*OrOutputMember) Set ¶
func (o *OrOutputMember) Set(value bool) bool
type Output ¶
type Output interface { //Name tells the human readable name of the output Name() string //Set changes the device state. It returns a flag wether the change was effective (i.e. returns false if nothing changed) Set(bool) bool //Get tells the actual device state Get() bool }
Output represents any controlled device which receives a single ON of OFF signal
type OutputDistributor ¶
type OutputDistributor struct {
// contains filtered or unexported fields
}
func NewOutputDistributor ¶
func NewOutputDistributor(name string, realOutputs []Output) *OutputDistributor
func (*OutputDistributor) Get ¶
func (m *OutputDistributor) Get() bool
func (*OutputDistributor) Name ¶
func (m *OutputDistributor) Name() string
func (*OutputDistributor) Set ¶
func (m *OutputDistributor) Set(value bool) bool
type TimerOutput ¶
type TimerOutput struct {
// contains filtered or unexported fields
}
func NewTimerOutput ¶
func NewTimerOutput(name string, output Output, now func() time.Time) TimerOutput
func (*TimerOutput) Degree ¶
func (t *TimerOutput) Degree() string
func (*TimerOutput) Get ¶
func (t *TimerOutput) Get() bool
func (*TimerOutput) Name ¶
func (t *TimerOutput) Name() string
func (*TimerOutput) Set ¶
func (t *TimerOutput) Set(value bool) bool
func (*TimerOutput) Type ¶
func (t *TimerOutput) Type() string
func (*TimerOutput) Value ¶
func (t *TimerOutput) Value() float64
Click to show internal directories.
Click to hide internal directories.