INNER CODE UNIT · Go

func

joshuar/go-hass-agent · agent/agent.go:77

func (a *Agent) IsRegistered() bool {
	return a.Config.Registered
}

// Register will mark the registration status of the agent as registered.
func (a *Agent) Register(ctx context.Context) {
	a.Config.Registered = true
	err := config.Save(ConfigPrefix, a.Config)
	if err != nil {
		slogctx.FromCtx(ctx).Error("Unable to save registration status to config.",
			slog.Any("error", err))
		return
	}
	close(registered)
}

// Reset will undo registration status of the agent.
func (a *Agent) Reset(ctx context.Context) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…