mirror of
https://github.com/home-assistant/core
synced 2024-08-02 23:40:32 +02: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)
|
||||
|
||||
|
||||
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
Block a user