stt

Go types for Home Assistant's stt domain: control over HTTP.

Control: HTTP
import "github.com/taumatix/homeassistant-go/domains/stt"

Overview

Package stt is Home Assistant's stt domain: its types.

Entity controls one stt entity over HTTP.

Home Assistant documents the domain here:

Integration: https://www.home-assistant.io/integrations/stt/

Entity model (developers): https://contributors.home-assistant.io/core/entities/stt/

Control

// client is an *api.Client
target := stt.Get(client, "my_stt")
state, err := target.State(ctx)

Control

type Entity struct

Entity controls one stt entity over HTTP (api.Client). State and Subscribe come from the embedded Handle.

Embeds entity.Handle[Attributes], whose methods it has too.

func Get(transport entity.Transport, id string) *Entity

Get returns the stt entity with the given id: an entity id over HTTP (the "stt." prefix may be omitted). It does no I/O.

func List(ctx context.Context, transport entity.Transport) ([]*Entity, error)

List returns every stt entity the transport can see.

type State = entity.State[Attributes]

State is a snapshot of one stt entity.

State and values

type Attributes struct

Attributes are the state attributes of a stt entity, under the names Home Assistant publishes them with.

See: https://www.home-assistant.io/integrations/stt/

AudioCodecs

type AudioCodecs string

AudioCodecs is core's AudioCodecs.

ConstantValue
AudioCodecsUnknown"Unknown"
AudioCodecsPcm"pcm"
AudioCodecsOpus"opus"
func AudioCodecsFromString(s string) AudioCodecs

AudioCodecsFromString returns the AudioCodecs spelled s, by its value or by the name of core's member, and AudioCodecsUnknown for anything else.

func (v *AudioCodecs) UnmarshalJSON(data []byte) error

UnmarshalJSON reads any spelling AudioCodecsFromString accepts.

AudioFormats

type AudioFormats string

AudioFormats is core's AudioFormats.

ConstantValue
AudioFormatsUnknown"Unknown"
AudioFormatsWav"wav"
AudioFormatsOgg"ogg"
func AudioFormatsFromString(s string) AudioFormats

AudioFormatsFromString returns the AudioFormats spelled s, by its value or by the name of core's member, and AudioFormatsUnknown for anything else.

func (v *AudioFormats) UnmarshalJSON(data []byte) error

UnmarshalJSON reads any spelling AudioFormatsFromString accepts.

type PartialSpeechResult struct

PartialSpeechResult is core's PartialSpeechResult.

See: https://www.home-assistant.io/integrations/stt/

FieldTypeWire keyDescription
SpeakerId*stringspeaker_id
Textstringtext
type SpeechAudioProcessing struct

SpeechAudioProcessing is core's SpeechAudioProcessing.

See: https://www.home-assistant.io/integrations/stt/

FieldTypeWire keyDescription
PrefersAutoGainEnabledboolprefers_auto_gain_enabled
PrefersNoiseReductionEnabledboolprefers_noise_reduction_enabled
RequiresExternalVadboolrequires_external_vad
type SpeechResult struct

SpeechResult is core's SpeechResult.

See: https://www.home-assistant.io/integrations/stt/

FieldTypeWire keyDescription
ResultSpeechResultStateresult
Text*stringtext

SpeechResultState

type SpeechResultState string

SpeechResultState is core's SpeechResultState.

ConstantValue
SpeechResultStateUnknown"Unknown"
SpeechResultStateSuccess"success"
SpeechResultStateError"error"
func SpeechResultStateFromString(s string) SpeechResultState

SpeechResultStateFromString returns the SpeechResultState spelled s, by its value or by the name of core's member, and SpeechResultStateUnknown for anything else.

func (v *SpeechResultState) UnmarshalJSON(data []byte) error

UnmarshalJSON reads any spelling SpeechResultStateFromString accepts.