diff --git a/homeassistant/components/http/__init__.py b/homeassistant/components/http/__init__.py index cdf3347e24f..f048d571b9c 100644 --- a/homeassistant/components/http/__init__.py +++ b/homeassistant/components/http/__init__.py @@ -37,12 +37,7 @@ from homeassistant.const import ( ) from homeassistant.core import Event, HomeAssistant, callback from homeassistant.exceptions import HomeAssistantError -from homeassistant.helpers import ( - config_validation as cv, - frame, - issue_registry as ir, - storage, -) +from homeassistant.helpers import config_validation as cv, issue_registry as ir, storage from homeassistant.helpers.http import ( KEY_ALLOW_CONFIGURED_CORS, KEY_AUTHENTICATED, # noqa: F401 @@ -505,25 +500,6 @@ class HomeAssistantHTTP: ) ) - def register_static_path( - self, url_path: str, path: str, cache_headers: bool = True - ) -> None: - """Register a folder or file to serve as a static path.""" - frame.report_usage( - "calls hass.http.register_static_path which " - "does blocking I/O in the event loop, instead " - "call `await hass.http.async_register_static_paths(" - f'[StaticPathConfig("{url_path}", "{path}", {cache_headers})])`', - exclude_integrations={"http"}, - core_behavior=frame.ReportBehavior.ERROR, - core_integration_behavior=frame.ReportBehavior.ERROR, - custom_integration_behavior=frame.ReportBehavior.ERROR, - breaks_in_ha_version="2025.7", - ) - configs = [StaticPathConfig(url_path, path, cache_headers)] - resources = self._make_static_resources(configs) - self._async_register_static_paths(configs, resources) - def _create_ssl_context(self) -> ssl.SSLContext | None: context: ssl.SSLContext | None = None assert self.ssl_certificate is not None diff --git a/tests/components/http/test_init.py b/tests/components/http/test_init.py index 7858bbc123d..195a291b140 100644 --- a/tests/components/http/test_init.py +++ b/tests/components/http/test_init.py @@ -522,24 +522,6 @@ async def test_logging( assert "GET /api/states/logging.entity" not in caplog.text -async def test_register_static_paths( - hass: HomeAssistant, - hass_client: ClientSessionGenerator, - caplog: pytest.LogCaptureFixture, -) -> None: - """Test registering a static path with old api.""" - assert await async_setup_component(hass, "frontend", {}) - path = str(Path(__file__).parent) - - match_error = ( - "Detected code that calls hass.http.register_static_path " - "which does blocking I/O in the event loop, instead call " - "`await hass.http.async_register_static_paths" - ) - with pytest.raises(RuntimeError, match=match_error): - hass.http.register_static_path("/something", path) - - async def test_ssl_issue_if_no_urls_configured( hass: HomeAssistant, tmp_path: Path,