pwm_fan

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Description = "Simple PWM fan controller for Viam"
View Source
var Model = resource.NewModel("viam-soleng", "fan", "pwm")
View Source
var PrettyName = "Raspberry Pi Clock Sensor"
View Source
var Version = utils.Version

Functions

func NewSensor

func NewSensor(ctx context.Context, deps resource.Dependencies, conf resource.Config, logger logging.Logger) (sensor.Sensor, error)

Types

type CloudConfig

type CloudConfig struct {
	BoardName        string             `json:"board_name"`
	FanPin           string             `json:"fan_pin"`
	SensorName       string             `json:"sensor_name"`
	SensorValueKey   string             `json:"sensor_value_key"`
	SensorValueRegex string             `json:"sensor_value_regex"`
	TemperatureTable map[string]float64 `json:"temperature_table"`
}

func (*CloudConfig) Validate

func (conf *CloudConfig) Validate(path string) ([]string, error)

type Config

type Config struct {
	resource.Named

	FanPin           board.GPIOPin
	Board            *board.Board
	TemperatureTable map[float64]float64
	Temps            []float64
	Sensor           sensor.Sensor
	SensorValueField string
	SensorValueRegex *regexp.Regexp
	// contains filtered or unexported fields
}

func (*Config) Close

func (c *Config) Close(ctx context.Context) error

func (*Config) Readings

func (c *Config) Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)

func (*Config) Ready

func (c *Config) Ready(ctx context.Context, extra map[string]interface{}) (bool, error)

func (*Config) Reconfigure

func (c *Config) Reconfigure(ctx context.Context, deps resource.Dependencies, conf resource.Config) error

Jump to

Keyboard shortcuts

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