diff --git a/homeassistant/helpers/service.py b/homeassistant/helpers/service.py index 6e1988fe4cd..4a10dfc5616 100644 --- a/homeassistant/helpers/service.py +++ b/homeassistant/helpers/service.py @@ -718,7 +718,6 @@ async def async_get_all_descriptions( for service_name in services_by_domain } # If we have a complete cache, check if it is still valid - all_cache: tuple[set[tuple[str, str]], dict[str, dict[str, Any]]] | None if all_cache := hass.data.get(ALL_SERVICE_DESCRIPTIONS_CACHE): previous_all_services, previous_descriptions_cache = all_cache # If the services are the same, we can return the cache @@ -744,7 +743,11 @@ async def async_get_all_descriptions( continue if TYPE_CHECKING: assert isinstance(int_or_exc, Exception) - _LOGGER.error("Failed to load integration: %s", domain, exc_info=int_or_exc) + _LOGGER.error( + "Failed to load services.yaml for integration: %s", + domain, + exc_info=int_or_exc, + ) if integrations: loaded = await hass.async_add_executor_job( @@ -772,7 +775,7 @@ async def async_get_all_descriptions( # Cache missing descriptions domain_yaml = loaded.get(domain) or {} # The YAML may be empty for dynamically defined - # services (ie shell_command) that never call + # services (e.g. shell_command) that never call # service.async_set_service_schema for the dynamic # service diff --git a/tests/helpers/test_service.py b/tests/helpers/test_service.py index 6b464faa110..5d018f5f3ee 100644 --- a/tests/helpers/test_service.py +++ b/tests/helpers/test_service.py @@ -1141,7 +1141,7 @@ async def test_async_get_all_descriptions_failing_integration( descriptions = await service.async_get_all_descriptions(hass) assert len(descriptions) == 3 - assert "Failed to load integration: logger" in caplog.text + assert "Failed to load services.yaml for integration: logger" in caplog.text # Services are empty defaults if the load fails but should # not raise