Skip to content

Commit e6e3f24

Browse files
authored
Add discovery_service_actions configuration option (home-assistant#156537)
1 parent c9c518e commit e6e3f24

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

homeassistant/components/cloud/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
CONF_ALIASES,
5656
CONF_API_SERVER,
5757
CONF_COGNITO_CLIENT_ID,
58+
CONF_DISCOVERY_SERVICE_ACTIONS,
5859
CONF_ENTITY_CONFIG,
5960
CONF_FILTER,
6061
CONF_GOOGLE_ACTIONS,
@@ -139,6 +140,7 @@
139140
{
140141
vol.Required(CONF_MODE): vol.In([MODE_DEV]),
141142
vol.Required(CONF_API_SERVER): str,
143+
vol.Optional(CONF_DISCOVERY_SERVICE_ACTIONS): {str: cv.url},
142144
}
143145
),
144146
_BASE_CONFIG_SCHEMA.extend(

homeassistant/components/cloud/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
CONF_ACCOUNTS_SERVER = "accounts_server"
8080
CONF_ACME_SERVER = "acme_server"
8181
CONF_API_SERVER = "api_server"
82+
CONF_DISCOVERY_SERVICE_ACTIONS = "discovery_service_actions"
8283
CONF_RELAYER_SERVER = "relayer_server"
8384
CONF_REMOTESTATE_SERVER = "remotestate_server"
8485
CONF_SERVICEHANDLERS_SERVER = "servicehandlers_server"

tests/components/cloud/test_init.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ async def test_constructor_loads_info_from_config(hass: HomeAssistant) -> None:
4747
"accounts_server": "test-acounts-server",
4848
"acme_server": "test-acme-server",
4949
"remotestate_server": "test-remotestate-server",
50+
"discovery_service_actions": {
51+
"lorem_ipsum": "https://lorem.ipsum/test-url"
52+
},
5053
},
5154
},
5255
)
@@ -63,6 +66,10 @@ async def test_constructor_loads_info_from_config(hass: HomeAssistant) -> None:
6366
assert cl.acme_server == "test-acme-server"
6467
assert cl.api_server == "test-api-server"
6568
assert cl.remotestate_server == "test-remotestate-server"
69+
assert (
70+
cl.service_discovery._action_overrides["lorem_ipsum"]
71+
== "https://lorem.ipsum/test-url"
72+
)
6673

6774

6875
@pytest.mark.usefixtures("mock_cloud_fixture")

0 commit comments

Comments
 (0)