diff --git a/homeassistant/components/hue/__init__.py b/homeassistant/components/hue/__init__.py index b294a811c61..7349f4fe6a6 100644 --- a/homeassistant/components/hue/__init__.py +++ b/homeassistant/components/hue/__init__.py @@ -36,6 +36,7 @@ BRIDGE_CONFIG_SCHEMA = vol.Schema( vol.Optional( CONF_ALLOW_HUE_GROUPS, default=DEFAULT_ALLOW_HUE_GROUPS ): cv.boolean, + vol.Optional("filename"): str, } ) @@ -46,8 +47,10 @@ CONFIG_SCHEMA = vol.Schema( vol.Optional(CONF_BRIDGES): vol.All( cv.ensure_list, [ - cv.deprecated("filename", invalidation_version="0.106.0"), - vol.All(BRIDGE_CONFIG_SCHEMA), + vol.All( + cv.deprecated("filename", invalidation_version="0.106.0"), + BRIDGE_CONFIG_SCHEMA, + ), ], ) } diff --git a/tests/components/hue/test_init.py b/tests/components/hue/test_init.py index 2e147fd097b..35e1ba689b4 100644 --- a/tests/components/hue/test_init.py +++ b/tests/components/hue/test_init.py @@ -29,12 +29,14 @@ async def test_setup_defined_hosts_known_auth(hass): hue.DOMAIN, { hue.DOMAIN: { - hue.CONF_BRIDGES: { - hue.CONF_HOST: "0.0.0.0", - hue.CONF_ALLOW_HUE_GROUPS: False, - hue.CONF_ALLOW_UNREACHABLE: True, - "filename": "bla", - } + hue.CONF_BRIDGES: [ + { + hue.CONF_HOST: "0.0.0.0", + hue.CONF_ALLOW_HUE_GROUPS: False, + hue.CONF_ALLOW_UNREACHABLE: True, + }, + {hue.CONF_HOST: "1.1.1.1", "filename": "bla"}, + ] } }, ) @@ -42,7 +44,7 @@ async def test_setup_defined_hosts_known_auth(hass): ) # Flow started for discovered bridge - assert len(hass.config_entries.flow.async_progress()) == 0 + assert len(hass.config_entries.flow.async_progress()) == 1 # Config stored for domain. assert hass.data[hue.DATA_CONFIGS] == { @@ -50,8 +52,13 @@ async def test_setup_defined_hosts_known_auth(hass): hue.CONF_HOST: "0.0.0.0", hue.CONF_ALLOW_HUE_GROUPS: False, hue.CONF_ALLOW_UNREACHABLE: True, + }, + "1.1.1.1": { + hue.CONF_HOST: "1.1.1.1", + hue.CONF_ALLOW_HUE_GROUPS: True, + hue.CONF_ALLOW_UNREACHABLE: False, "filename": "bla", - } + }, }