config

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir added in v0.0.12

func Dir() string

func File added in v0.0.12

func File() string

func Init

func Init()

func Notification added in v0.0.12

func Notification() []string

func Print

func Print()

Types

type Config added in v0.0.12

type Config struct {
	General       GeneralConfig          `yaml:"general"`
	Log           LogConfig              `yaml:"log"`
	Persons       []Person               `yaml:"persons"`
	Devices       []DeviceConfig         `yaml:"devices"`
	Zones         []ZoneConfig           `yaml:"zones"`
	Zigbee2Mqtt   []Zigbee2MqttConfig    `yaml:"zigbee2mqtt"`
	HomeAssistant []HomeAssistantConfig  `yaml:"homeassistant"`
	WhatsApp      *WhatsAppConfiguration `yaml:"whatsapp"`
	Notification  []string               `yaml:"notifications"`
}

type DeviceConfig

type DeviceConfig struct {
	Id   string `yaml:"id"`
	Zone string `yaml:"zone"`
}

func Devices added in v0.0.12

func Devices() []DeviceConfig

type GeneralConfig added in v0.0.12

type GeneralConfig struct {
	Name                        string  `yaml:"name" default:"My Home"`
	ExitDelay                   int     `yaml:"exitDelay" default:"30"`
	EntryDelay                  int     `yaml:"entryDelay" default:"30"`
	MaxWrongPinCount            int     `yaml:"maxWrongPinCount" default:"2"`
	BatteryThreshold            float32 `yaml:"batteryThreshold" default:"0.1"`
	LinkQualityThreshold        float32 `yaml:"linkQualityThreshold" default:"0.1"`
	TamperAlarmWhileArmed       bool    `yaml:"tamperAlarmWhileArmed" default:"true"`
	TamperAlarmWhileDisarmed    bool    `yaml:"tamperAlarmWhileDisarmed" default:"false"`
	DeviceSystemFaultAlarm      bool    `yaml:"deviceSystemFaultAlarm" default:"true"`
	DeviceSystemFaultAlarmDelay int     `yaml:"deviceSystemFaultAlarmDelay" default:"300"`
}

func General added in v0.0.12

func General() GeneralConfig

type HomeAssistantConfig

type HomeAssistantConfig struct {
	Id    string `yaml:"id"`
	Url   string `yaml:"url"`
	Token string `yaml:"token"`
}

func HomeAssistant added in v0.0.12

func HomeAssistant() []HomeAssistantConfig

type LogConfig added in v0.0.12

type LogConfig struct {
	Level  string `yaml:"level" default:"info"`
	Format string `yaml:"format" default:"text"`
}

func Log added in v0.0.12

func Log() LogConfig

type Person

type Person struct {
	Name     string `yaml:"name"`
	Pin      string `yaml:"pin"`
	Lang     string `yaml:"lang"`
	WhatsApp string `yaml:"whatsapp"`
}

func Persons

func Persons() []Person

type WhatsAppConfiguration

type WhatsAppConfiguration struct {
	PhoneId              string `yaml:"phoneId"`
	TemplateAlarm        string `yaml:"templateAlarm"`
	TemplateAutoArm      string `yaml:"templateAutoArm"`
	TemplateAutoDisarm   string `yaml:"templateAutoDisarm"`
	TemplateNotification string `yaml:"templateNotification"`
	TemplateRecover      string `yaml:"templateRecover"`
	Token                string `yaml:"token"`
}

func WhatsApp added in v0.0.12

func WhatsApp() *WhatsAppConfiguration

type Zigbee2MqttConfig

type Zigbee2MqttConfig struct {
	Id        string `yaml:"id"`
	Url       string `yaml:"url"`
	ClientId  string `yaml:"clientId"`
	Username  string `yaml:"username"`
	Password  string `yaml:"password"`
	BaseTopic string `yaml:"baseTopic"`
}

func Zigbee2Mqtt added in v0.0.12

func Zigbee2Mqtt() []Zigbee2MqttConfig

type ZoneConfig

type ZoneConfig struct {
	Id          string `yaml:"id"`
	DisplayName string `yaml:"displayName"`
	Perimeter   bool   `yaml:"perimeter"`
	Delayed     bool   `yaml:"delayed"`
}

func Zones added in v0.0.12

func Zones() []ZoneConfig

Jump to

Keyboard shortcuts

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