homeassistant

package
v0.0.0-...-bf199b6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event[D any] struct {
	Type      string    `json:"type"`
	Data      *D        `json:"data"`
	Timestamp time.Time `json:"timestamp"`
}

type HomeAssistant

type HomeAssistant struct {
	// contains filtered or unexported fields
}

func GetHomeAssistantConnection

func GetHomeAssistantConnection() *HomeAssistant

func NewHomeAssistantConnection

func NewHomeAssistantConnection(conf *config.Config, logger *log.Logger) *HomeAssistant

func (*HomeAssistant) AwaitResponse

func (ha *HomeAssistant) AwaitResponse(reqID int) ([]byte, error)

func (*HomeAssistant) Done

func (ha *HomeAssistant) Done(reqID int) error

func (*HomeAssistant) GetPipelineManager

func (ha *HomeAssistant) GetPipelineManager() *PipelineManager

func (*HomeAssistant) NextRequestId

func (ha *HomeAssistant) NextRequestId() int

func (*HomeAssistant) Request

func (ha *HomeAssistant) Request(reqID int, evt interface{}) (chan []byte, error)

func (*HomeAssistant) Run

func (ha *HomeAssistant) Run()

type IntentEnd

type IntentEnd struct {
	IntentOutput struct {
		Response       IntentOutputResponse `json:"response"`
		ConversationID *string              `json:"conversation_id"`
	} `json:"intent_output"`
}

type IntentOutputResponse

type IntentOutputResponse struct {
	Speech struct {
		Plain struct {
			Speech string `json:"speech"`
		} `json:"plain"`
	} `json:"speech"`
	Language      string `json:"language"`
	ResponseTypes string `json:"response_type"`
}

type Pipeline

type Pipeline struct {
	ID                   string `json:"id"`
	ConversationEngine   string `json:"conversation_engine"`
	ConversationLanguage string `json:"conversation_language"`
	Language             string `json:"language"`
	Name                 string `json:"name"`
	STTEngine            string `json:"stt_engine"`
	SSTLanguage          string `json:"stt_language"`
	TTSEngine            string `json:"tts_engine"`
	TTSLanguage          string `json:"tts_language"`
	WakeWordEntity       string `json:"wake_word_entity"`
	WakeWordID           string `json:"wake_word_id"`
}

type PipelineManager

type PipelineManager struct {
	PreferredPipeline string
	ConversationId    *string
	// contains filtered or unexported fields
}

func (*PipelineManager) GetPipeline

func (pm *PipelineManager) GetPipeline(id string) (Pipeline, error)

func (*PipelineManager) ListPipelines

func (pm *PipelineManager) ListPipelines() ([]Pipeline, error)

func (*PipelineManager) RunTextPipeline

func (pm *PipelineManager) RunTextPipeline(id string, text string) (string, error)

type Response

type Response[D any] struct {
	ID    int      `json:"id"`
	Type  string   `json:"type"`
	Event Event[D] `json:"event"`
}

type RunPipelineCommand

type RunPipelineCommand struct {
	ID             int              `json:"id"`
	Type           string           `json:"type"`
	StartStage     string           `json:"start_stage"`
	EndStage       string           `json:"end_stage"`
	PipelineID     string           `json:"pipeline"`
	ConversationID *string          `json:"conversation_id"`
	Input          RunPipelineInput `json:"input"`
}

type RunPipelineInput

type RunPipelineInput struct {
	Text string `json:"text"`
}

Jump to

Keyboard shortcuts

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