Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
SensorMap = map[string]Sensor{}
)
Functions ¶
This section is empty.
Types ¶
type CmdSensor ¶
type CmdSensor struct { Name string `json:"name"` Config configuration.SensorConfig `json:"configuration"` MovingAvg float64 `json:"movingAvg"` }
func (CmdSensor) GetConfig ¶
func (sensor CmdSensor) GetConfig() configuration.SensorConfig
func (CmdSensor) GetMovingAvg ¶
func (*CmdSensor) SetMovingAvg ¶
type FileSensor ¶
type FileSensor struct { Config configuration.SensorConfig `json:"configuration"` MovingAvg float64 `json:"movingAvg"` }
func (FileSensor) GetConfig ¶
func (sensor FileSensor) GetConfig() configuration.SensorConfig
func (FileSensor) GetId ¶
func (sensor FileSensor) GetId() string
func (FileSensor) GetMovingAvg ¶
func (sensor FileSensor) GetMovingAvg() (avg float64)
func (FileSensor) GetValue ¶
func (sensor FileSensor) GetValue() (float64, error)
func (*FileSensor) SetMovingAvg ¶
func (sensor *FileSensor) SetMovingAvg(avg float64)
type HwmonSensor ¶
type HwmonSensor struct { Label string `json:"label"` Index int `json:"index"` Input string `json:"string"` Max int `json:"max"` Min int `json:"min"` Config configuration.SensorConfig `json:"configuration"` MovingAvg float64 `json:"movingAvg"` }
func (HwmonSensor) GetConfig ¶
func (sensor HwmonSensor) GetConfig() configuration.SensorConfig
func (HwmonSensor) GetId ¶
func (sensor HwmonSensor) GetId() string
func (HwmonSensor) GetMovingAvg ¶
func (sensor HwmonSensor) GetMovingAvg() (avg float64)
func (HwmonSensor) GetValue ¶
func (sensor HwmonSensor) GetValue() (result float64, err error)
func (*HwmonSensor) SetMovingAvg ¶
func (sensor *HwmonSensor) SetMovingAvg(avg float64)
type Sensor ¶
type Sensor interface { GetId() string GetConfig() configuration.SensorConfig // GetValue returns the current value of this sensor GetValue() (float64, error) // GetMovingAvg returns the moving average of this sensor's value GetMovingAvg() float64 SetMovingAvg(avg float64) }
func NewSensor ¶
func NewSensor(config configuration.SensorConfig) (Sensor, error)
type VirtualSensor ¶
func (VirtualSensor) GetConfig ¶
func (sensor VirtualSensor) GetConfig() configuration.SensorConfig
func (VirtualSensor) GetId ¶
func (sensor VirtualSensor) GetId() string
func (VirtualSensor) GetMovingAvg ¶
func (sensor VirtualSensor) GetMovingAvg() (avg float64)
func (VirtualSensor) GetValue ¶
func (sensor VirtualSensor) GetValue() (float64, error)
func (*VirtualSensor) SetMovingAvg ¶
func (sensor *VirtualSensor) SetMovingAvg(avg float64)
Click to show internal directories.
Click to hide internal directories.