Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/openai_conversation/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{%- for area in areas %}
{%- set area_info = namespace(printed=false) %}
{%- for device in area_devices(area.name) -%}
{%- if not device_attr(device, "disabled_by") and not device_attr(device, "entry_type") %}
{%- if not device_attr(device, "disabled_by") and not device_attr(device, "entry_type") and device_attr(device, "name") %}
{%- if not area_info.printed %}

{{ area.name }}:
Expand Down
7 changes: 7 additions & 0 deletions tests/components/openai_conversation/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ async def test_default_prompt(hass, mock_init_component):
device_reg.async_update_device(
device.id, disabled_by=device_registry.DeviceEntryDisabler.USER
)
device = device_reg.async_get_or_create(
config_entry_id="1234",
connections={("test", "9876-no-name")},
manufacturer="Test Manufacturer NoName",
model="Test Model NoName",
suggested_area="Test Area 2",
)

with patch("openai.Completion.acreate") as mock_create:
result = await conversation.async_converse(hass, "hello", None, Context())
Expand Down