controller

package
v0.0.0-...-5228f54 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFanStalledAtMaxPwm = errors.New("fan stalled at max pwm")
)
View Source
var InitializationSequenceMutex sync.Mutex

Functions

This section is empty.

Types

type DefaultFanController

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

func (*DefaultFanController) GetFanId

func (f *DefaultFanController) GetFanId() string

func (*DefaultFanController) GetStatistics

func (f *DefaultFanController) GetStatistics() FanControllerStatistics

func (*DefaultFanController) Run

func (*DefaultFanController) RunInitializationSequence

func (f *DefaultFanController) RunInitializationSequence() (err error)

func (*DefaultFanController) UpdateFanSpeed

func (f *DefaultFanController) UpdateFanSpeed() error

type FanController

type FanController interface {
	// Run starts the control loop
	Run(ctx context.Context) error

	GetFanId() string

	GetStatistics() FanControllerStatistics

	// RunInitializationSequence for the given fan to determine its characteristics
	RunInitializationSequence() (err error)

	UpdateFanSpeed() error
}

func NewFanController

func NewFanController(
	persistence persistence.Persistence,
	fan fans.Fan,
	controlLoop control_loop.ControlLoop,
	updateRate time.Duration,
) FanController

type FanControllerStatistics

type FanControllerStatistics struct {
	UnexpectedPwmValueCount int
	IncreasedMinPwmCount    int
	MinPwmOffset            int
}

Jump to

Keyboard shortcuts

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