Skip to content

Commit

Permalink
Rename voice_assistant to assist_pipeline (#91371)
Browse files Browse the repository at this point in the history
* Rename voice_assistant to assist_pipeline

* Fix tests

* Fix voip test

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
  • Loading branch information
3 people authored Apr 13, 2023
1 parent 32344a8 commit 4e80154
Show file tree
Hide file tree
Showing 23 changed files with 63 additions and 63 deletions.
4 changes: 2 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/arris_tg2492lg/ @vanbalken
/homeassistant/components/aseko_pool_live/ @milanmeu
/tests/components/aseko_pool_live/ @milanmeu
/homeassistant/components/assist_pipeline/ @balloob @synesthesiam
/tests/components/assist_pipeline/ @balloob @synesthesiam
/homeassistant/components/asuswrt/ @kennedyshead @ollo69
/tests/components/asuswrt/ @kennedyshead @ollo69
/homeassistant/components/atag/ @MatsNL
Expand Down Expand Up @@ -1312,8 +1314,6 @@ build.json @home-assistant/supervisor
/tests/components/vizio/ @raman325
/homeassistant/components/vlc_telnet/ @rodripf @MartinHjelmare
/tests/components/vlc_telnet/ @rodripf @MartinHjelmare
/homeassistant/components/voice_assistant/ @balloob @synesthesiam
/tests/components/voice_assistant/ @balloob @synesthesiam
/homeassistant/components/voip/ @balloob @synesthesiam
/tests/components/voip/ @balloob @synesthesiam
/homeassistant/components/volumio/ @OnFreund
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""The Voice Assistant integration."""
"""The Assist pipeline integration."""
from __future__ import annotations

from collections.abc import AsyncIterable
Expand Down Expand Up @@ -33,7 +33,7 @@


async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up Voice Assistant integration."""
"""Set up the Assist pipeline integration."""
await async_setup_pipeline_store(hass)
async_register_websocket_api(hass)

Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/assist_pipeline/const.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"""Constants for the Assist pipeline integration."""
DOMAIN = "assist_pipeline"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Voice Assistant errors."""
"""Assist pipeline errors."""

from homeassistant.exceptions import HomeAssistantError

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"domain": "voice_assistant",
"name": "Voice Assistant",
"domain": "assist_pipeline",
"name": "Assist pipeline",
"codeowners": ["@balloob", "@synesthesiam"],
"dependencies": ["conversation", "stt", "tts"],
"documentation": "https://www.home-assistant.io/integrations/voice_assistant",
"documentation": "https://www.home-assistant.io/integrations/assist_pipeline",
"iot_class": "local_push",
"quality_scale": "internal",
"requirements": ["webrtcvad==2.0.10"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Voice Assistant Websocket API."""
"""Assist pipeline Websocket API."""
import asyncio
import audioop # pylint: disable=deprecated-module
from collections.abc import Callable
Expand Down Expand Up @@ -33,12 +33,12 @@ def async_register_websocket_api(hass: HomeAssistant) -> None:
"""Register the websocket API."""
websocket_api.async_register_command(
hass,
"voice_assistant/run",
"assist_pipeline/run",
websocket_run,
vol.All(
websocket_api.BASE_COMMAND_MESSAGE_SCHEMA.extend(
{
vol.Required("type"): "voice_assistant/run",
vol.Required("type"): "assist_pipeline/run",
# pylint: disable-next=unnecessary-lambda
vol.Required("start_stage"): lambda val: PipelineStage(val),
# pylint: disable-next=unnecessary-lambda
Expand Down
2 changes: 0 additions & 2 deletions homeassistant/components/voice_assistant/const.py

This file was deleted.

2 changes: 1 addition & 1 deletion homeassistant/components/voip/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Voice over IP",
"codeowners": ["@balloob", "@synesthesiam"],
"config_flow": true,
"dependencies": ["voice_assistant"],
"dependencies": ["assist_pipeline"],
"documentation": "https://www.home-assistant.io/integrations/voip",
"iot_class": "local_push",
"quality_scale": "internal",
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/voip/voip.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
from voip_utils import CallInfo, RtpDatagramProtocol, SdpInfo, VoipDatagramProtocol

from homeassistant.components import stt, tts
from homeassistant.components.voice_assistant import (
from homeassistant.components.assist_pipeline import (
Pipeline,
PipelineEvent,
PipelineEventType,
async_pipeline_from_audio_stream,
)
from homeassistant.components.voice_assistant.vad import VoiceCommandSegmenter
from homeassistant.components.assist_pipeline.vad import VoiceCommandSegmenter
from homeassistant.const import __version__
from homeassistant.core import HomeAssistant

Expand Down
12 changes: 6 additions & 6 deletions homeassistant/generated/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,12 @@
"config_flow": true,
"iot_class": "cloud_polling"
},
"assist_pipeline": {
"name": "Assist pipeline",
"integration_type": "hub",
"config_flow": false,
"iot_class": "local_push"
},
"asterisk": {
"name": "Asterisk",
"integrations": {
Expand Down Expand Up @@ -6056,12 +6062,6 @@
}
}
},
"voice_assistant": {
"name": "Voice Assistant",
"integration_type": "hub",
"config_flow": false,
"iot_class": "local_push"
},
"voicerss": {
"name": "VoiceRSS",
"integration_type": "hub",
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2619,7 +2619,7 @@ waterfurnace==1.1.0
# homeassistant.components.cisco_webex_teams
webexteamssdk==1.1.1

# homeassistant.components.voice_assistant
# homeassistant.components.assist_pipeline
webrtcvad==2.0.10

# homeassistant.components.whirlpool
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,7 @@ wallbox==0.4.12
# homeassistant.components.folder_watcher
watchdog==2.3.1

# homeassistant.components.voice_assistant
# homeassistant.components.assist_pipeline
webrtcvad==2.0.10

# homeassistant.components.whirlpool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ async def init_components(
assert await async_setup_component(hass, tts.DOMAIN, {"tts": {"platform": "test"}})
assert await async_setup_component(hass, stt.DOMAIN, {"stt": {"platform": "test"}})
assert await async_setup_component(hass, "media_source", {})
assert await async_setup_component(hass, "voice_assistant", {})
assert await async_setup_component(hass, "assist_pipeline", {})
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from syrupy.assertion import SnapshotAssertion

from homeassistant.components import stt, voice_assistant
from homeassistant.components import assist_pipeline, stt
from homeassistant.core import HomeAssistant


Expand All @@ -18,7 +18,7 @@ async def audio_data():
yield b"part2"
yield b""

await voice_assistant.async_pipeline_from_audio_stream(
await assist_pipeline.async_pipeline_from_audio_stream(
hass,
events.append,
stt.SpeechMetadata(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Websocket tests for Voice Assistant integration."""
from typing import Any

from homeassistant.components.voice_assistant.const import DOMAIN
from homeassistant.components.voice_assistant.pipeline import (
from homeassistant.components.assist_pipeline.const import DOMAIN
from homeassistant.components.assist_pipeline.pipeline import (
STORAGE_KEY,
STORAGE_VERSION,
PipelineStorageCollection,
Expand Down Expand Up @@ -67,7 +67,7 @@ async def test_loading_datasets_from_storage(
hass_storage[STORAGE_KEY] = {
"version": 1,
"minor_version": 1,
"key": "voice_assistant.pipelines",
"key": "assist_pipeline.pipelines",
"data": {
"items": [
{
Expand Down Expand Up @@ -98,7 +98,7 @@ async def test_loading_datasets_from_storage(
},
}

assert await async_setup_component(hass, "voice_assistant", {})
assert await async_setup_component(hass, "assist_pipeline", {})

store: PipelineStorageCollection = hass.data[DOMAIN]
assert len(store.data) == 3
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Tests for webrtcvad voice command segmenter."""
from unittest.mock import patch

from homeassistant.components.voice_assistant.vad import VoiceCommandSegmenter
from homeassistant.components.assist_pipeline.vad import VoiceCommandSegmenter

_ONE_SECOND = 16000 * 2 # 16Khz 16-bit

Expand Down
Loading

0 comments on commit 4e80154

Please sign in to comment.