Documentation ¶
Index ¶
Constants ¶
const (
Name = "go-hass-agent"
)
Variables ¶
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) DeviceDetails ¶ added in v0.1.0
func (*Agent) IsRegistered ¶ added in v1.3.0
func (*Agent) LoadConfig ¶ added in v1.0.0
func (agent *Agent) LoadConfig() *agentConfig
type AgentOptions ¶ added in v1.3.0
AgentOptions holds options taken from the command-line that was used to invoke go-hass-agent that are relevant for agent functionality.