mirror of
https://github.com/home-assistant/core.git
synced 2025-04-28 03:07:50 +00:00
Remove the deprecated discovery_info endpoint (#64534)
This commit is contained in:
parent
3258f66097
commit
04c5e51cbd
@ -19,7 +19,6 @@ from homeassistant.const import (
|
|||||||
URL_API,
|
URL_API,
|
||||||
URL_API_COMPONENTS,
|
URL_API_COMPONENTS,
|
||||||
URL_API_CONFIG,
|
URL_API_CONFIG,
|
||||||
URL_API_DISCOVERY_INFO,
|
|
||||||
URL_API_ERROR_LOG,
|
URL_API_ERROR_LOG,
|
||||||
URL_API_EVENTS,
|
URL_API_EVENTS,
|
||||||
URL_API_SERVICES,
|
URL_API_SERVICES,
|
||||||
@ -56,7 +55,6 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
hass.http.register_view(APIStatusView)
|
hass.http.register_view(APIStatusView)
|
||||||
hass.http.register_view(APIEventStream)
|
hass.http.register_view(APIEventStream)
|
||||||
hass.http.register_view(APIConfigView)
|
hass.http.register_view(APIConfigView)
|
||||||
hass.http.register_view(APIDiscoveryView)
|
|
||||||
hass.http.register_view(APIStatesView)
|
hass.http.register_view(APIStatesView)
|
||||||
hass.http.register_view(APIEntityStateView)
|
hass.http.register_view(APIEntityStateView)
|
||||||
hass.http.register_view(APIEventListenersView)
|
hass.http.register_view(APIEventListenersView)
|
||||||
@ -167,33 +165,6 @@ class APIConfigView(HomeAssistantView):
|
|||||||
return self.json(request.app["hass"].config.as_dict())
|
return self.json(request.app["hass"].config.as_dict())
|
||||||
|
|
||||||
|
|
||||||
class APIDiscoveryView(HomeAssistantView):
|
|
||||||
"""
|
|
||||||
View to provide Discovery information.
|
|
||||||
|
|
||||||
DEPRECATED: To be removed in 2022.1
|
|
||||||
"""
|
|
||||||
|
|
||||||
requires_auth = False
|
|
||||||
url = URL_API_DISCOVERY_INFO
|
|
||||||
name = "api:discovery"
|
|
||||||
|
|
||||||
async def get(self, request):
|
|
||||||
"""Get discovery information."""
|
|
||||||
return self.json(
|
|
||||||
{
|
|
||||||
ATTR_UUID: "",
|
|
||||||
ATTR_BASE_URL: "",
|
|
||||||
ATTR_EXTERNAL_URL: "",
|
|
||||||
ATTR_INTERNAL_URL: "",
|
|
||||||
ATTR_LOCATION_NAME: "",
|
|
||||||
ATTR_INSTALLATION_TYPE: "",
|
|
||||||
ATTR_REQUIRES_API_PASSWORD: True,
|
|
||||||
ATTR_VERSION: "",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class APIStatesView(HomeAssistantView):
|
class APIStatesView(HomeAssistantView):
|
||||||
"""View to handle States requests."""
|
"""View to handle States requests."""
|
||||||
|
|
||||||
|
@ -699,7 +699,6 @@ URL_ROOT: Final = "/"
|
|||||||
URL_API: Final = "/api/"
|
URL_API: Final = "/api/"
|
||||||
URL_API_STREAM: Final = "/api/stream"
|
URL_API_STREAM: Final = "/api/stream"
|
||||||
URL_API_CONFIG: Final = "/api/config"
|
URL_API_CONFIG: Final = "/api/config"
|
||||||
URL_API_DISCOVERY_INFO: Final = "/api/discovery_info"
|
|
||||||
URL_API_STATES: Final = "/api/states"
|
URL_API_STATES: Final = "/api/states"
|
||||||
URL_API_STATES_ENTITY: Final = "/api/states/{}"
|
URL_API_STATES_ENTITY: Final = "/api/states/{}"
|
||||||
URL_API_EVENTS: Final = "/api/events"
|
URL_API_EVENTS: Final = "/api/events"
|
||||||
|
@ -560,20 +560,3 @@ async def test_api_call_service_bad_data(hass, mock_api_client):
|
|||||||
"/api/services/test_domain/test_service", json={"hello": 5}
|
"/api/services/test_domain/test_service", json={"hello": 5}
|
||||||
)
|
)
|
||||||
assert resp.status == HTTPStatus.BAD_REQUEST
|
assert resp.status == HTTPStatus.BAD_REQUEST
|
||||||
|
|
||||||
|
|
||||||
async def test_api_get_discovery_info(hass, mock_api_client):
|
|
||||||
"""Test the return of discovery info."""
|
|
||||||
resp = await mock_api_client.get(const.URL_API_DISCOVERY_INFO)
|
|
||||||
result = await resp.json()
|
|
||||||
|
|
||||||
assert result == {
|
|
||||||
"base_url": "",
|
|
||||||
"external_url": "",
|
|
||||||
"installation_type": "",
|
|
||||||
"internal_url": "",
|
|
||||||
"location_name": "",
|
|
||||||
"requires_api_password": True,
|
|
||||||
"uuid": "",
|
|
||||||
"version": "",
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user