thermal

package
v0.0.0-...-efe4ef5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package thermal exposes an HTTP interface to thermal controllers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTemperature

func GetTemperature(c Controller) http.HandlerFunc

GetTemperature returns an HTTP handler func that returns the temperature over HTTP

func GetTemperatureSetpoint

func GetTemperatureSetpoint(c Controller) http.HandlerFunc

GetTemperatureSetpoint returns the temperature as JSON over HTTP

func HTTPController

func HTTPController(c Controller, table generichttp.RouteTable)

HTTPController binds routes to control temperature to the table

func SetTemperatureSetpoint

func SetTemperatureSetpoint(c Controller) http.HandlerFunc

SetTemperatureSetpoint returns an HTTP handler func that sets the temperature setpoint over HTTP

Types

type Controller

type Controller interface {
	// GetTemperatureSetpoint gets the temperature setpoint in Celcius
	GetTemperatureSetpoint() (float64, error)

	// SetTemperatureSetpoint sets the temperature setpoint in Celcius
	SetTemperatureSetpoint(float64) error

	// GetTemperature gets the temperature in Celcius
	GetTemperature() (float64, error)
}

Controller is an interface to a thermal controller with a single channel

Jump to

Keyboard shortcuts

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