config

package
v0.0.0-...-5657e6c Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPort = 8080

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port    int                     `json:"port"`
	Sensors map[string]SensorConfig `json:"sensors"`
	Zones   map[string]ZoneConfig   `json:"zones"`
}

func LoadConfig

func LoadConfig(input io.Reader) (*Config, error)

func New

func New() *Config

type SensorConfig

type SensorConfig struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

type ThermostatConfig

type ThermostatConfig struct {
	Sensor        string            `json:"sensor"`
	DefaultTarget units.Temperature `json:"default_target"`
}

type ZoneConfig

type ZoneConfig struct {
	Virtual    bool              `json:"virtual"`
	GPIOPin    int               `json:"gpio_pin"`
	Thermostat *ThermostatConfig `json:"thermostat"`
}

Jump to

Keyboard shortcuts

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