mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Include subentries in Google Generative AI diagnostics (#147558)
This commit is contained in:
parent
38669ce96c
commit
fb133664e4
@ -21,6 +21,7 @@ async def async_get_config_entry_diagnostics(
|
||||
"title": entry.title,
|
||||
"data": entry.data,
|
||||
"options": entry.options,
|
||||
"subentries": dict(entry.subentries),
|
||||
},
|
||||
TO_REDACT,
|
||||
)
|
||||
|
@ -34,12 +34,14 @@ def mock_config_entry(hass: HomeAssistant) -> MockConfigEntry:
|
||||
"data": {},
|
||||
"subentry_type": "conversation",
|
||||
"title": DEFAULT_CONVERSATION_NAME,
|
||||
"subentry_id": "ulid-conversation",
|
||||
"unique_id": None,
|
||||
},
|
||||
{
|
||||
"data": {},
|
||||
"subentry_type": "tts",
|
||||
"title": DEFAULT_TTS_NAME,
|
||||
"subentry_id": "ulid-tts",
|
||||
"unique_id": None,
|
||||
},
|
||||
],
|
||||
|
@ -5,6 +5,10 @@
|
||||
'api_key': '**REDACTED**',
|
||||
}),
|
||||
'options': dict({
|
||||
}),
|
||||
'subentries': dict({
|
||||
'ulid-conversation': dict({
|
||||
'data': dict({
|
||||
'chat_model': 'models/gemini-2.5-flash',
|
||||
'dangerous_block_threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||
'harassment_block_threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||
@ -17,6 +21,20 @@
|
||||
'top_k': 64,
|
||||
'top_p': 0.95,
|
||||
}),
|
||||
'subentry_id': 'ulid-conversation',
|
||||
'subentry_type': 'conversation',
|
||||
'title': 'Google AI Conversation',
|
||||
'unique_id': None,
|
||||
}),
|
||||
'ulid-tts': dict({
|
||||
'data': dict({
|
||||
}),
|
||||
'subentry_id': 'ulid-tts',
|
||||
'subentry_type': 'tts',
|
||||
'title': 'Google AI TTS',
|
||||
'unique_id': None,
|
||||
}),
|
||||
}),
|
||||
'title': 'Google Generative AI Conversation',
|
||||
})
|
||||
# ---
|
||||
|
@ -35,10 +35,10 @@ async def test_diagnostics(
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
"""Test diagnostics."""
|
||||
mock_config_entry.add_to_hass(hass)
|
||||
hass.config_entries.async_update_entry(
|
||||
hass.config_entries.async_update_subentry(
|
||||
mock_config_entry,
|
||||
options={
|
||||
next(iter(mock_config_entry.subentries.values())),
|
||||
data={
|
||||
CONF_RECOMMENDED: False,
|
||||
CONF_PROMPT: "Speak like a pirate",
|
||||
CONF_TEMPERATURE: RECOMMENDED_TEMPERATURE,
|
||||
|
Loading…
x
Reference in New Issue
Block a user