From 8d6ca7126f7f165ee2934c91e27c1ac7ecceee79 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 23 Jan 2024 12:41:23 -1000 Subject: [PATCH] Add blog post for new async_services_for_domain (#2050) --- blog/2024-01-22-async_services_for_domain.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 blog/2024-01-22-async_services_for_domain.md diff --git a/blog/2024-01-22-async_services_for_domain.md b/blog/2024-01-22-async_services_for_domain.md new file mode 100644 index 00000000..964215ed --- /dev/null +++ b/blog/2024-01-22-async_services_for_domain.md @@ -0,0 +1,9 @@ +--- +author: J. Nick Koston +authorURL: https://github.com/bdraco +title: Enumerating services +--- + +In Home Assistant 2024.2, we will introduce `hass.services.async_services_for_domain()`, which is a new way to enumerate services by domain, allowing integrations to inspect which services are available without having to obtain all the services on the system. We found that most integrations are only interested in the services they provide, and it was expensive to enumerate all the services in the system when an integration was only interested in their services. + +Integrations that call `hass.services.async_services()[DOMAIN]` to get services for a specific domain should replace the call with `hass.services.async_services_for_domain(DOMAIN)`. \ No newline at end of file