Allow None agent in conversation (#63761)
parent
eacd9f9994
commit
8fcca8c88b
|
@ -221,7 +221,7 @@ async def _configure_almond_for_ha(
|
|||
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."""
|
||||
conversation.async_set_agent(hass, None)
|
||||
return True
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
"""Support for functionality to have conversations with Home Assistant."""
|
||||
from __future__ import annotations
|
||||
|
||||
from http import HTTPStatus
|
||||
import logging
|
||||
import re
|
||||
|
@ -48,7 +50,7 @@ async_register = bind_hass(async_register)
|
|||
|
||||
@core.callback
|
||||
@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."""
|
||||
hass.data[DATA_AGENT] = agent
|
||||
|
||||
|
|
Loading…
Reference in New Issue