Reload config entry for anthropic on update (#123280)

* Reload config entry for anthropic on update

* Fix tests
This commit is contained in:
Paulus Schoutsen 2024-08-07 12:22:50 +02:00 committed by GitHub
parent 799888df2f
commit 45ce0fed0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View File

@ -312,9 +312,5 @@ class AnthropicConversationEntity(
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)

View File

@ -43,6 +43,7 @@ async def mock_init_component(hass, mock_config_entry):
):
assert await async_setup_component(hass, "anthropic", {})
await hass.async_block_till_done()
yield
@pytest.fixture(autouse=True)