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.
AudioCodecs
type AudioCodecs string
AudioCodecs is core's AudioCodecs.
| Constant | Value |
|---|---|
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.
| Constant | Value |
|---|---|
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/
| Field | Type | Wire key | Description |
|---|---|---|---|
SpeakerId | *string | speaker_id | |
Text | string | text |
type SpeechAudioProcessing struct
SpeechAudioProcessing is core's SpeechAudioProcessing.
See: https://www.home-assistant.io/integrations/stt/
| Field | Type | Wire key | Description |
|---|---|---|---|
PrefersAutoGainEnabled | bool | prefers_auto_gain_enabled | |
PrefersNoiseReductionEnabled | bool | prefers_noise_reduction_enabled | |
RequiresExternalVad | bool | requires_external_vad |
type SpeechResult struct
SpeechResult is core's SpeechResult.
See: https://www.home-assistant.io/integrations/stt/
| Field | Type | Wire key | Description |
|---|---|---|---|
Result | SpeechResultState | result | |
Text | *string | text |
SpeechResultState
type SpeechResultState string
SpeechResultState is core's SpeechResultState.
| Constant | Value |
|---|---|
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.