mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
OpenAI: Ignore devices without a name (#87558)
Ignore devices without a name
This commit is contained in:
parent
590bdc1f49
commit
5bc49b1757
@ -9,7 +9,7 @@ An overview of the areas and the devices in this smart home:
|
|||||||
{%- for area in areas %}
|
{%- for area in areas %}
|
||||||
{%- set area_info = namespace(printed=false) %}
|
{%- set area_info = namespace(printed=false) %}
|
||||||
{%- for device in area_devices(area.name) -%}
|
{%- 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 %}
|
{%- if not area_info.printed %}
|
||||||
|
|
||||||
{{ area.name }}:
|
{{ area.name }}:
|
||||||
|
@ -67,6 +67,13 @@ async def test_default_prompt(hass, mock_init_component):
|
|||||||
device_reg.async_update_device(
|
device_reg.async_update_device(
|
||||||
device.id, disabled_by=device_registry.DeviceEntryDisabler.USER
|
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.create") as mock_create:
|
with patch("openai.Completion.create") as mock_create:
|
||||||
result = await conversation.async_converse(hass, "hello", None, Context())
|
result = await conversation.async_converse(hass, "hello", None, Context())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user