mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Allow None agent in conversation (#63761)
This commit is contained in:
parent
eacd9f9994
commit
8fcca8c88b
@ -221,7 +221,7 @@ async def _configure_almond_for_ha(
|
|||||||
await hass.auth.async_remove_refresh_token(token)
|
await hass.auth.async_remove_refresh_token(token)
|
||||||
|
|
||||||
|
|
||||||
async def async_unload_entry(hass, entry):
|
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Unload Almond."""
|
"""Unload Almond."""
|
||||||
conversation.async_set_agent(hass, None)
|
conversation.async_set_agent(hass, None)
|
||||||
return True
|
return True
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
"""Support for functionality to have conversations with Home Assistant."""
|
"""Support for functionality to have conversations with Home Assistant."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
@ -48,7 +50,7 @@ async_register = bind_hass(async_register)
|
|||||||
|
|
||||||
@core.callback
|
@core.callback
|
||||||
@bind_hass
|
@bind_hass
|
||||||
def async_set_agent(hass: core.HomeAssistant, agent: AbstractConversationAgent):
|
def async_set_agent(hass: core.HomeAssistant, agent: AbstractConversationAgent | None):
|
||||||
"""Set the agent to handle the conversations."""
|
"""Set the agent to handle the conversations."""
|
||||||
hass.data[DATA_AGENT] = agent
|
hass.data[DATA_AGENT] = agent
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user