Reload conversation entries on update (#123279)
parent
270990fe39
commit
db32460f3b
|
@ -346,9 +346,5 @@ class OllamaConversationEntity(
|
|||
self, hass: HomeAssistant, entry: ConfigEntry
|
||||
) -> None:
|
||||
"""Handle options update."""
|
||||
if entry.options.get(CONF_LLM_HASS_API):
|
||||
self._attr_supported_features = (
|
||||
conversation.ConversationEntityFeature.CONTROL
|
||||
)
|
||||
else:
|
||||
self._attr_supported_features = conversation.ConversationEntityFeature(0)
|
||||
# Reload as we update device info + entity name + supported features
|
||||
await hass.config_entries.async_reload(entry.entry_id)
|
||||
|
|
|
@ -328,9 +328,5 @@ class OpenAIConversationEntity(
|
|||
self, hass: HomeAssistant, entry: ConfigEntry
|
||||
) -> None:
|
||||
"""Handle options update."""
|
||||
if entry.options.get(CONF_LLM_HASS_API):
|
||||
self._attr_supported_features = (
|
||||
conversation.ConversationEntityFeature.CONTROL
|
||||
)
|
||||
else:
|
||||
self._attr_supported_features = conversation.ConversationEntityFeature(0)
|
||||
# Reload as we update device info + entity name + supported features
|
||||
await hass.config_entries.async_reload(entry.entry_id)
|
||||
|
|
|
@ -48,6 +48,7 @@ async def mock_init_component(hass: HomeAssistant, mock_config_entry: MockConfig
|
|||
):
|
||||
assert await async_setup_component(hass, ollama.DOMAIN, {})
|
||||
await hass.async_block_till_done()
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
|
|
@ -312,6 +312,7 @@ async def test_unknown_hass_api(
|
|||
CONF_LLM_HASS_API: "non-existing",
|
||||
},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
result = await conversation.async_converse(
|
||||
hass, "hello", None, Context(), agent_id=mock_config_entry.entry_id
|
||||
|
|
Loading…
Reference in New Issue