From 5b0c7321b5de4287991ac623887385bfbed038cc Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Sun, 5 Feb 2023 17:34:37 +0000 Subject: [PATCH] Add missing name field to emulated_hue config (#87456) Co-authored-by: J. Nick Koston --- homeassistant/components/emulated_hue/hue_api.py | 1 + tests/components/emulated_hue/test_hue_api.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/emulated_hue/hue_api.py b/homeassistant/components/emulated_hue/hue_api.py index a81544151ea..b855d0c738d 100644 --- a/homeassistant/components/emulated_hue/hue_api.py +++ b/homeassistant/components/emulated_hue/hue_api.py @@ -831,6 +831,7 @@ def create_hue_success_response( def create_config_model(config: Config, request: web.Request) -> dict[str, Any]: """Create a config resource.""" return { + "name": "HASS BRIDGE", "mac": "00:00:00:00:00:00", "swversion": "01003542", "apiversion": "1.17.0", diff --git a/tests/components/emulated_hue/test_hue_api.py b/tests/components/emulated_hue/test_hue_api.py index 58303ce54a6..cfadccc39c4 100644 --- a/tests/components/emulated_hue/test_hue_api.py +++ b/tests/components/emulated_hue/test_hue_api.py @@ -465,8 +465,9 @@ async def test_discover_full_state(hue_client): # Make sure array is correct size assert len(result_json) == 2 - assert len(config_json) == 6 + assert len(config_json) == 7 assert len(lights_json) >= 1 + assert "name" in config_json # Make sure the config wrapper added to the config is there assert "mac" in config_json @@ -505,7 +506,8 @@ async def test_discover_config(hue_client): config_json = await result.json() # Make sure array is correct size - assert len(config_json) == 6 + assert len(config_json) == 7 + assert "name" in config_json # Make sure the config wrapper added to the config is there assert "mac" in config_json