config

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeEnabled

func ChangeEnabled(filepath string, newEnabled bool) (err error)

ChangeEnabled rewrites an Automation config with the first "Enabled = <bool>" changed to the supplied state.

func CheckMainConfig

func CheckMainConfig(configDir string) error

CheckMainConfig performs a simple sanity check on the main config.toml and its directory

func PreprocessTOML

func PreprocessTOML(configDir string, fileName string) (preprocessed []byte, e error)

PreprocessTOML reads a TOML config file and substitutes !!SECRET() and !!CONSTANT() strings for their corresponding values.

Types

type MainConfigT

type MainConfigT struct {
	SystemName          string
	Longitude, Latitude float64
	MqttBroker          string
	MqttPort            int
	MqttUsername        string
	MqttPassword        string
	MqttClientID        string
	MqttBaseTopic       string
	Integrations        []string
	ControlPort         int
	ConfigDir           string
}

A MainConfigT holds the top-level configuration details

func LoadMainConfig

func LoadMainConfig(configDir string) (MainConfigT, error)

LoadMainConfig does what it says on the tin

Jump to

Keyboard shortcuts

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