Skip to content

Commit

Permalink
Migrate google_assistant_sdk to use async_update_entry to alter confi…
Browse files Browse the repository at this point in the history
…g entries (#110307)
  • Loading branch information
bdraco committed Feb 12, 2024
1 parent 8376c07 commit b5d9f27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/components/google_assistant_sdk/test_init.py
Expand Up @@ -131,7 +131,9 @@ async def test_send_text_command(
assert len(entries) == 1
assert entries[0].state is ConfigEntryState.LOADED
if configured_language_code:
entries[0].options = {"language_code": configured_language_code}
hass.config_entries.async_update_entry(
entries[0], options={"language_code": configured_language_code}
)

command = "turn on home assistant unsupported device"
with patch(
Expand Down
8 changes: 6 additions & 2 deletions tests/components/google_assistant_sdk/test_notify.py
Expand Up @@ -33,7 +33,9 @@ async def test_broadcast_no_targets(
await setup_integration()

entry = hass.config_entries.async_entries(DOMAIN)[0]
entry.options = {"language_code": language_code}
hass.config_entries.async_update_entry(
entry, options={"language_code": language_code}
)

with patch(
"homeassistant.components.google_assistant_sdk.helpers.TextAssistant"
Expand Down Expand Up @@ -87,7 +89,9 @@ async def test_broadcast_one_target(
await setup_integration()

entry = hass.config_entries.async_entries(DOMAIN)[0]
entry.options = {"language_code": language_code}
hass.config_entries.async_update_entry(
entry, options={"language_code": language_code}
)

with patch(
"homeassistant.components.google_assistant_sdk.helpers.TextAssistant.assist",
Expand Down

0 comments on commit b5d9f27

Please sign in to comment.