agent

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "go-hass-agent"
)

Variables

View Source
var Version string

Functions

func Register added in v1.3.0

func Register(options AgentOptions, server, token string)

Register runs a registration flow. It either prompts the user for needed information or parses what is already provided. It will send a registration request to Home Assistant and handles the response. It will handle either a UI or non-UI registration flow.

func Run

func Run(options AgentOptions)

Run is the "main loop" of the agent. It sets up the agent, loads the config then spawns a sensor tracker and the workers to gather sensor data and publish it to Home Assistant

func ShowInfo added in v1.4.1

func ShowInfo(options AgentOptions)

func ShowVersion added in v1.4.1

func ShowVersion(options AgentOptions)

Types

type Agent

type Agent struct {
	Name, Version string
	// contains filtered or unexported fields
}

Agent holds the data and structure representing an instance of the agent. This includes the data structure for the UI elements and tray and some strings such as app name and version.

func (*Agent) AppConfigVersion added in v0.1.0

func (agent *Agent) AppConfigVersion() string

func (*Agent) DeviceDetails added in v0.1.0

func (agent *Agent) DeviceDetails() (string, string)

func (*Agent) IsRegistered added in v1.3.0

func (agent *Agent) IsRegistered() bool

func (*Agent) LoadConfig added in v1.0.0

func (agent *Agent) LoadConfig() *agentConfig

func (*Agent) SetPref added in v0.1.0

func (agent *Agent) SetPref(pref string, value interface{})

type AgentOptions added in v1.3.0

type AgentOptions struct {
	ID                 string
	Headless, Register bool
}

AgentOptions holds options taken from the command-line that was used to invoke go-hass-agent that are relevant for agent functionality.

Jump to

Keyboard shortcuts

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