This commit is contained in:
Franck Nijhof 2024-12-13 12:16:14 +01:00 committed by GitHub
commit 46db3964f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 240 additions and 48 deletions

View File

@ -135,15 +135,16 @@ async def async_connect_androidtv(
) )
aftv = await async_androidtv_setup( aftv = await async_androidtv_setup(
config[CONF_HOST], host=config[CONF_HOST],
config[CONF_PORT], port=config[CONF_PORT],
adbkey, adbkey=adbkey,
config.get(CONF_ADB_SERVER_IP), adb_server_ip=config.get(CONF_ADB_SERVER_IP),
config.get(CONF_ADB_SERVER_PORT, DEFAULT_ADB_SERVER_PORT), adb_server_port=config.get(CONF_ADB_SERVER_PORT, DEFAULT_ADB_SERVER_PORT),
state_detection_rules, state_detection_rules=state_detection_rules,
config[CONF_DEVICE_CLASS], device_class=config[CONF_DEVICE_CLASS],
timeout, auth_timeout_s=timeout,
signer, signer=signer,
log_errors=False,
) )
if not aftv.available: if not aftv.available:

View File

@ -5,5 +5,5 @@
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/aosmith", "documentation": "https://www.home-assistant.io/integrations/aosmith",
"iot_class": "cloud_polling", "iot_class": "cloud_polling",
"requirements": ["py-aosmith==1.0.11"] "requirements": ["py-aosmith==1.0.12"]
} }

View File

@ -29,6 +29,7 @@ from homeassistant.components import (
from homeassistant.components.tts import ( from homeassistant.components.tts import (
generate_media_source_id as tts_generate_media_source_id, generate_media_source_id as tts_generate_media_source_id,
) )
from homeassistant.const import MATCH_ALL
from homeassistant.core import Context, HomeAssistant, callback from homeassistant.core import Context, HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import intent from homeassistant.helpers import intent
@ -1009,12 +1010,19 @@ class PipelineRun:
if self.intent_agent is None: if self.intent_agent is None:
raise RuntimeError("Recognize intent was not prepared") raise RuntimeError("Recognize intent was not prepared")
if self.pipeline.conversation_language == MATCH_ALL:
# LLMs support all languages ('*') so use pipeline language for
# intent fallback.
input_language = self.pipeline.language
else:
input_language = self.pipeline.conversation_language
self.process_event( self.process_event(
PipelineEvent( PipelineEvent(
PipelineEventType.INTENT_START, PipelineEventType.INTENT_START,
{ {
"engine": self.intent_agent, "engine": self.intent_agent,
"language": self.pipeline.conversation_language, "language": input_language,
"intent_input": intent_input, "intent_input": intent_input,
"conversation_id": conversation_id, "conversation_id": conversation_id,
"device_id": device_id, "device_id": device_id,
@ -1029,7 +1037,7 @@ class PipelineRun:
context=self.context, context=self.context,
conversation_id=conversation_id, conversation_id=conversation_id,
device_id=device_id, device_id=device_id,
language=self.pipeline.language, language=input_language,
agent_id=self.intent_agent, agent_id=self.intent_agent,
) )
processed_locally = self.intent_agent == conversation.HOME_ASSISTANT_AGENT processed_locally = self.intent_agent == conversation.HOME_ASSISTANT_AGENT

View File

@ -140,7 +140,7 @@ class VoiceCommandSegmenter:
self._timeout_seconds_left -= chunk_seconds self._timeout_seconds_left -= chunk_seconds
if self._timeout_seconds_left <= 0: if self._timeout_seconds_left <= 0:
_LOGGER.warning( _LOGGER.debug(
"VAD end of speech detection timed out after %s seconds", "VAD end of speech detection timed out after %s seconds",
self.timeout_seconds, self.timeout_seconds,
) )

View File

@ -6,6 +6,6 @@
"documentation": "https://www.home-assistant.io/integrations/daikin", "documentation": "https://www.home-assistant.io/integrations/daikin",
"iot_class": "local_polling", "iot_class": "local_polling",
"loggers": ["pydaikin"], "loggers": ["pydaikin"],
"requirements": ["pydaikin==2.13.7"], "requirements": ["pydaikin==2.13.8"],
"zeroconf": ["_dkapi._tcp.local."] "zeroconf": ["_dkapi._tcp.local."]
} }

View File

@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/ecovacs", "documentation": "https://www.home-assistant.io/integrations/ecovacs",
"iot_class": "cloud_push", "iot_class": "cloud_push",
"loggers": ["sleekxmppfs", "sucks", "deebot_client"], "loggers": ["sleekxmppfs", "sucks", "deebot_client"],
"requirements": ["py-sucks==0.9.10", "deebot-client==9.3.0"] "requirements": ["py-sucks==0.9.10", "deebot-client==9.4.0"]
} }

View File

@ -6,5 +6,5 @@
"iot_class": "cloud_polling", "iot_class": "cloud_polling",
"loggers": ["evohomeasync", "evohomeasync2"], "loggers": ["evohomeasync", "evohomeasync2"],
"quality_scale": "legacy", "quality_scale": "legacy",
"requirements": ["evohome-async==0.4.20"] "requirements": ["evohome-async==0.4.21"]
} }

View File

@ -20,5 +20,5 @@
"documentation": "https://www.home-assistant.io/integrations/frontend", "documentation": "https://www.home-assistant.io/integrations/frontend",
"integration_type": "system", "integration_type": "system",
"quality_scale": "internal", "quality_scale": "internal",
"requirements": ["home-assistant-frontend==20241127.7"] "requirements": ["home-assistant-frontend==20241127.8"]
} }

View File

@ -249,7 +249,10 @@ class LaMetricFlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
device = await lametric.device() device = await lametric.device()
if self.source != SOURCE_REAUTH: if self.source != SOURCE_REAUTH:
await self.async_set_unique_id(device.serial_number) await self.async_set_unique_id(
device.serial_number,
raise_on_progress=False,
)
self._abort_if_unique_id_configured( self._abort_if_unique_id_configured(
updates={CONF_HOST: lametric.host, CONF_API_KEY: lametric.api_key} updates={CONF_HOST: lametric.host, CONF_API_KEY: lametric.api_key}
) )

View File

@ -21,8 +21,11 @@
"api_key": "You can find this API key in [devices page in your LaMetric developer account](https://developer.lametric.com/user/devices)." "api_key": "You can find this API key in [devices page in your LaMetric developer account](https://developer.lametric.com/user/devices)."
} }
}, },
"user_cloud_select_device": { "cloud_select_device": {
"data": { "data": {
"device": "Device"
},
"data_description": {
"device": "Select the LaMetric device to add" "device": "Select the LaMetric device to add"
} }
} }

View File

@ -35,5 +35,5 @@
"dependencies": ["bluetooth_adapters"], "dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/led_ble", "documentation": "https://www.home-assistant.io/integrations/led_ble",
"iot_class": "local_polling", "iot_class": "local_polling",
"requirements": ["bluetooth-data-tools==1.20.0", "led-ble==1.0.2"] "requirements": ["bluetooth-data-tools==1.20.0", "led-ble==1.1.1"]
} }

View File

@ -7,6 +7,6 @@
"integration_type": "hub", "integration_type": "hub",
"iot_class": "local_polling", "iot_class": "local_polling",
"loggers": ["linkplay"], "loggers": ["linkplay"],
"requirements": ["python-linkplay==0.0.20"], "requirements": ["python-linkplay==0.1.1"],
"zeroconf": ["_linkplay._tcp.local."] "zeroconf": ["_linkplay._tcp.local."]
} }

View File

@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/suez_water", "documentation": "https://www.home-assistant.io/integrations/suez_water",
"iot_class": "cloud_polling", "iot_class": "cloud_polling",
"loggers": ["pysuez", "regex"], "loggers": ["pysuez", "regex"],
"requirements": ["pysuezV2==1.3.2"] "requirements": ["pysuezV2==1.3.5"]
} }

View File

@ -2,6 +2,7 @@
from dataclasses import dataclass from dataclasses import dataclass
from datetime import datetime, timedelta from datetime import datetime, timedelta
from json.decoder import JSONDecodeError
from typing import Any from typing import Any
from aiovodafone import VodafoneStationDevice, VodafoneStationSercommApi, exceptions from aiovodafone import VodafoneStationDevice, VodafoneStationSercommApi, exceptions
@ -107,6 +108,7 @@ class VodafoneStationRouter(DataUpdateCoordinator[UpdateCoordinatorDataType]):
exceptions.CannotConnect, exceptions.CannotConnect,
exceptions.AlreadyLogged, exceptions.AlreadyLogged,
exceptions.GenericLoginError, exceptions.GenericLoginError,
JSONDecodeError,
) as err: ) as err:
raise UpdateFailed(f"Error fetching data: {err!r}") from err raise UpdateFailed(f"Error fetching data: {err!r}") from err
except (ConfigEntryAuthFailed, UpdateFailed): except (ConfigEntryAuthFailed, UpdateFailed):

View File

@ -8,5 +8,5 @@
"documentation": "https://www.home-assistant.io/integrations/withings", "documentation": "https://www.home-assistant.io/integrations/withings",
"iot_class": "cloud_push", "iot_class": "cloud_push",
"loggers": ["aiowithings"], "loggers": ["aiowithings"],
"requirements": ["aiowithings==3.1.3"] "requirements": ["aiowithings==3.1.4"]
} }

View File

@ -25,7 +25,7 @@ if TYPE_CHECKING:
APPLICATION_NAME: Final = "HomeAssistant" APPLICATION_NAME: Final = "HomeAssistant"
MAJOR_VERSION: Final = 2024 MAJOR_VERSION: Final = 2024
MINOR_VERSION: Final = 12 MINOR_VERSION: Final = 12
PATCH_VERSION: Final = "2" PATCH_VERSION: Final = "3"
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}" __short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__: Final = f"{__short_version__}.{PATCH_VERSION}" __version__: Final = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 12, 0) REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 12, 0)

View File

@ -34,7 +34,7 @@ habluetooth==3.6.0
hass-nabucasa==0.86.0 hass-nabucasa==0.86.0
hassil==2.0.5 hassil==2.0.5
home-assistant-bluetooth==1.13.0 home-assistant-bluetooth==1.13.0
home-assistant-frontend==20241127.7 home-assistant-frontend==20241127.8
home-assistant-intents==2024.12.9 home-assistant-intents==2024.12.9
httpx==0.27.2 httpx==0.27.2
ifaddr==0.2.0 ifaddr==0.2.0

View File

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "homeassistant" name = "homeassistant"
version = "2024.12.2" version = "2024.12.3"
license = {text = "Apache-2.0"} license = {text = "Apache-2.0"}
description = "Open-source home automation platform running on Python 3." description = "Open-source home automation platform running on Python 3."
readme = "README.rst" readme = "README.rst"

View File

@ -420,7 +420,7 @@ aiowatttime==0.1.1
aiowebostv==0.4.2 aiowebostv==0.4.2
# homeassistant.components.withings # homeassistant.components.withings
aiowithings==3.1.3 aiowithings==3.1.4
# homeassistant.components.yandex_transport # homeassistant.components.yandex_transport
aioymaps==1.2.5 aioymaps==1.2.5
@ -738,7 +738,7 @@ debugpy==1.8.8
# decora==0.6 # decora==0.6
# homeassistant.components.ecovacs # homeassistant.components.ecovacs
deebot-client==9.3.0 deebot-client==9.4.0
# homeassistant.components.ihc # homeassistant.components.ihc
# homeassistant.components.namecheapdns # homeassistant.components.namecheapdns
@ -878,7 +878,7 @@ eufylife-ble-client==0.1.8
# evdev==1.6.1 # evdev==1.6.1
# homeassistant.components.evohome # homeassistant.components.evohome
evohome-async==0.4.20 evohome-async==0.4.21
# homeassistant.components.bryant_evolution # homeassistant.components.bryant_evolution
evolutionhttp==0.0.18 evolutionhttp==0.0.18
@ -1130,7 +1130,7 @@ hole==0.8.0
holidays==0.62 holidays==0.62
# homeassistant.components.frontend # homeassistant.components.frontend
home-assistant-frontend==20241127.7 home-assistant-frontend==20241127.8
# homeassistant.components.conversation # homeassistant.components.conversation
home-assistant-intents==2024.12.9 home-assistant-intents==2024.12.9
@ -1280,7 +1280,7 @@ ld2410-ble==0.1.1
leaone-ble==0.1.0 leaone-ble==0.1.0
# homeassistant.components.led_ble # homeassistant.components.led_ble
led-ble==1.0.2 led-ble==1.1.1
# homeassistant.components.lektrico # homeassistant.components.lektrico
lektricowifi==0.0.43 lektricowifi==0.0.43
@ -1672,7 +1672,7 @@ pushover_complete==1.1.1
pvo==2.1.1 pvo==2.1.1
# homeassistant.components.aosmith # homeassistant.components.aosmith
py-aosmith==1.0.11 py-aosmith==1.0.12
# homeassistant.components.canary # homeassistant.components.canary
py-canary==0.5.4 py-canary==0.5.4
@ -1835,7 +1835,7 @@ pycsspeechtts==1.0.8
# pycups==2.0.4 # pycups==2.0.4
# homeassistant.components.daikin # homeassistant.components.daikin
pydaikin==2.13.7 pydaikin==2.13.8
# homeassistant.components.danfoss_air # homeassistant.components.danfoss_air
pydanfossair==0.1.0 pydanfossair==0.1.0
@ -2293,7 +2293,7 @@ pysqueezebox==0.10.0
pystiebeleltron==0.0.1.dev2 pystiebeleltron==0.0.1.dev2
# homeassistant.components.suez_water # homeassistant.components.suez_water
pysuezV2==1.3.2 pysuezV2==1.3.5
# homeassistant.components.switchbee # homeassistant.components.switchbee
pyswitchbee==1.8.3 pyswitchbee==1.8.3
@ -2365,7 +2365,7 @@ python-juicenet==1.1.0
python-kasa[speedups]==0.8.1 python-kasa[speedups]==0.8.1
# homeassistant.components.linkplay # homeassistant.components.linkplay
python-linkplay==0.0.20 python-linkplay==0.1.1
# homeassistant.components.lirc # homeassistant.components.lirc
# python-lirc==1.2.3 # python-lirc==1.2.3

View File

@ -402,7 +402,7 @@ aiowatttime==0.1.1
aiowebostv==0.4.2 aiowebostv==0.4.2
# homeassistant.components.withings # homeassistant.components.withings
aiowithings==3.1.3 aiowithings==3.1.4
# homeassistant.components.yandex_transport # homeassistant.components.yandex_transport
aioymaps==1.2.5 aioymaps==1.2.5
@ -628,7 +628,7 @@ dbus-fast==2.24.3
debugpy==1.8.8 debugpy==1.8.8
# homeassistant.components.ecovacs # homeassistant.components.ecovacs
deebot-client==9.3.0 deebot-client==9.4.0
# homeassistant.components.ihc # homeassistant.components.ihc
# homeassistant.components.namecheapdns # homeassistant.components.namecheapdns
@ -744,7 +744,7 @@ eternalegypt==0.0.16
eufylife-ble-client==0.1.8 eufylife-ble-client==0.1.8
# homeassistant.components.evohome # homeassistant.components.evohome
evohome-async==0.4.20 evohome-async==0.4.21
# homeassistant.components.bryant_evolution # homeassistant.components.bryant_evolution
evolutionhttp==0.0.18 evolutionhttp==0.0.18
@ -956,7 +956,7 @@ hole==0.8.0
holidays==0.62 holidays==0.62
# homeassistant.components.frontend # homeassistant.components.frontend
home-assistant-frontend==20241127.7 home-assistant-frontend==20241127.8
# homeassistant.components.conversation # homeassistant.components.conversation
home-assistant-intents==2024.12.9 home-assistant-intents==2024.12.9
@ -1076,7 +1076,7 @@ ld2410-ble==0.1.1
leaone-ble==0.1.0 leaone-ble==0.1.0
# homeassistant.components.led_ble # homeassistant.components.led_ble
led-ble==1.0.2 led-ble==1.1.1
# homeassistant.components.lektrico # homeassistant.components.lektrico
lektricowifi==0.0.43 lektricowifi==0.0.43
@ -1367,7 +1367,7 @@ pushover_complete==1.1.1
pvo==2.1.1 pvo==2.1.1
# homeassistant.components.aosmith # homeassistant.components.aosmith
py-aosmith==1.0.11 py-aosmith==1.0.12
# homeassistant.components.canary # homeassistant.components.canary
py-canary==0.5.4 py-canary==0.5.4
@ -1485,7 +1485,7 @@ pycountry==24.6.1
pycsspeechtts==1.0.8 pycsspeechtts==1.0.8
# homeassistant.components.daikin # homeassistant.components.daikin
pydaikin==2.13.7 pydaikin==2.13.8
# homeassistant.components.deako # homeassistant.components.deako
pydeako==0.6.0 pydeako==0.6.0
@ -1850,7 +1850,7 @@ pyspeex-noise==1.0.2
pysqueezebox==0.10.0 pysqueezebox==0.10.0
# homeassistant.components.suez_water # homeassistant.components.suez_water
pysuezV2==1.3.2 pysuezV2==1.3.5
# homeassistant.components.switchbee # homeassistant.components.switchbee
pyswitchbee==1.8.3 pyswitchbee==1.8.3
@ -1892,7 +1892,7 @@ python-juicenet==1.1.0
python-kasa[speedups]==0.8.1 python-kasa[speedups]==0.8.1
# homeassistant.components.linkplay # homeassistant.components.linkplay
python-linkplay==0.0.20 python-linkplay==0.1.1
# homeassistant.components.matter # homeassistant.components.matter
python-matter-server==6.6.0 python-matter-server==6.6.0

View File

@ -142,7 +142,7 @@
'data': dict({ 'data': dict({
'code': 'no_intent_match', 'code': 'no_intent_match',
}), }),
'language': 'en', 'language': 'en-US',
'response_type': 'error', 'response_type': 'error',
'speech': dict({ 'speech': dict({
'plain': dict({ 'plain': dict({
@ -233,7 +233,7 @@
'data': dict({ 'data': dict({
'code': 'no_intent_match', 'code': 'no_intent_match',
}), }),
'language': 'en', 'language': 'en-US',
'response_type': 'error', 'response_type': 'error',
'speech': dict({ 'speech': dict({
'plain': dict({ 'plain': dict({
@ -387,6 +387,57 @@
}), }),
]) ])
# --- # ---
# name: test_pipeline_language_used_instead_of_conversation_language
list([
dict({
'data': dict({
'language': 'en',
'pipeline': <ANY>,
}),
'type': <PipelineEventType.RUN_START: 'run-start'>,
}),
dict({
'data': dict({
'conversation_id': None,
'device_id': None,
'engine': 'conversation.home_assistant',
'intent_input': 'test input',
'language': 'en',
'prefer_local_intents': False,
}),
'type': <PipelineEventType.INTENT_START: 'intent-start'>,
}),
dict({
'data': dict({
'intent_output': dict({
'conversation_id': None,
'response': dict({
'card': dict({
}),
'data': dict({
'failed': list([
]),
'success': list([
]),
'targets': list([
]),
}),
'language': 'en',
'response_type': 'action_done',
'speech': dict({
}),
}),
}),
'processed_locally': True,
}),
'type': <PipelineEventType.INTENT_END: 'intent-end'>,
}),
dict({
'data': None,
'type': <PipelineEventType.RUN_END: 'run-end'>,
}),
])
# ---
# name: test_wake_word_detection_aborted # name: test_wake_word_detection_aborted
list([ list([
dict({ dict({

View File

@ -23,6 +23,7 @@ from homeassistant.components.assist_pipeline.const import (
CONF_DEBUG_RECORDING_DIR, CONF_DEBUG_RECORDING_DIR,
DOMAIN, DOMAIN,
) )
from homeassistant.const import MATCH_ALL
from homeassistant.core import Context, HomeAssistant from homeassistant.core import Context, HomeAssistant
from homeassistant.helpers import intent from homeassistant.helpers import intent
from homeassistant.setup import async_setup_component from homeassistant.setup import async_setup_component
@ -1098,3 +1099,77 @@ async def test_prefer_local_intents(
] ]
== "Order confirmed" == "Order confirmed"
) )
async def test_pipeline_language_used_instead_of_conversation_language(
hass: HomeAssistant,
hass_ws_client: WebSocketGenerator,
init_components,
snapshot: SnapshotAssertion,
) -> None:
"""Test that the pipeline language is used when the conversation language is '*' (all languages)."""
client = await hass_ws_client(hass)
events: list[assist_pipeline.PipelineEvent] = []
await client.send_json_auto_id(
{
"type": "assist_pipeline/pipeline/create",
"conversation_engine": "homeassistant",
"conversation_language": MATCH_ALL,
"language": "en",
"name": "test_name",
"stt_engine": "test",
"stt_language": "en-US",
"tts_engine": "test",
"tts_language": "en-US",
"tts_voice": "Arnold Schwarzenegger",
"wake_word_entity": None,
"wake_word_id": None,
}
)
msg = await client.receive_json()
assert msg["success"]
pipeline_id = msg["result"]["id"]
pipeline = assist_pipeline.async_get_pipeline(hass, pipeline_id)
pipeline_input = assist_pipeline.pipeline.PipelineInput(
intent_input="test input",
run=assist_pipeline.pipeline.PipelineRun(
hass,
context=Context(),
pipeline=pipeline,
start_stage=assist_pipeline.PipelineStage.INTENT,
end_stage=assist_pipeline.PipelineStage.INTENT,
event_callback=events.append,
),
)
await pipeline_input.validate()
with patch(
"homeassistant.components.assist_pipeline.pipeline.conversation.async_converse",
return_value=conversation.ConversationResult(
intent.IntentResponse(pipeline.language)
),
) as mock_async_converse:
await pipeline_input.execute()
# Check intent start event
assert process_events(events) == snapshot
intent_start: assist_pipeline.PipelineEvent | None = None
for event in events:
if event.type == assist_pipeline.PipelineEventType.INTENT_START:
intent_start = event
break
assert intent_start is not None
# Pipeline language (en) should be used instead of '*'
assert intent_start.data.get("language") == pipeline.language
# Check input to async_converse
mock_async_converse.assert_called_once()
assert (
mock_async_converse.call_args_list[0].kwargs.get("language")
== pipeline.language
)

View File

@ -30,6 +30,7 @@ from homeassistant.const import (
ATTR_DEVICE_CLASS, ATTR_DEVICE_CLASS,
ATTR_FRIENDLY_NAME, ATTR_FRIENDLY_NAME,
STATE_CLOSED, STATE_CLOSED,
STATE_OFF,
STATE_ON, STATE_ON,
STATE_UNKNOWN, STATE_UNKNOWN,
EntityCategory, EntityCategory,
@ -3049,3 +3050,49 @@ async def test_entities_names_are_not_templates(hass: HomeAssistant) -> None:
assert result is not None assert result is not None
assert result.response.response_type == intent.IntentResponseType.ERROR assert result.response.response_type == intent.IntentResponseType.ERROR
@pytest.mark.parametrize(
("language", "light_name", "on_sentence", "off_sentence"),
[
("en", "test light", "turn on test light", "turn off test light"),
("zh-cn", "卧室灯", "打开卧室灯", "关闭卧室灯"),
("zh-hk", "睡房燈", "打開睡房燈", "關閉睡房燈"),
("zh-tw", "臥室檯燈", "打開臥室檯燈", "關臥室檯燈"),
],
)
@pytest.mark.usefixtures("init_components")
async def test_turn_on_off(
hass: HomeAssistant,
language: str,
light_name: str,
on_sentence: str,
off_sentence: str,
) -> None:
"""Test turn on/off in multiple languages."""
entity_id = "light.light1234"
hass.states.async_set(
entity_id, STATE_OFF, attributes={ATTR_FRIENDLY_NAME: light_name}
)
on_calls = async_mock_service(hass, LIGHT_DOMAIN, "turn_on")
await conversation.async_converse(
hass,
on_sentence,
None,
Context(),
language=language,
)
assert len(on_calls) == 1
assert on_calls[0].data.get("entity_id") == [entity_id]
off_calls = async_mock_service(hass, LIGHT_DOMAIN, "turn_off")
await conversation.async_converse(
hass,
off_sentence,
None,
Context(),
language=language,
)
assert len(off_calls) == 1
assert off_calls[0].data.get("entity_id") == [entity_id]

View File

@ -31,8 +31,10 @@ async def test_diagnostics(
patch.object(LinkPlayMultiroom, "update_status", return_value=None), patch.object(LinkPlayMultiroom, "update_status", return_value=None),
): ):
endpoints = [ endpoints = [
LinkPlayApiEndpoint(protocol="https", endpoint=HOST, session=None), LinkPlayApiEndpoint(
LinkPlayApiEndpoint(protocol="http", endpoint=HOST, session=None), protocol="https", port=443, endpoint=HOST, session=None
),
LinkPlayApiEndpoint(protocol="http", port=80, endpoint=HOST, session=None),
] ]
for endpoint in endpoints: for endpoint in endpoints:
mock_session.get( mock_session.get(