Add blog post for new async_services_for_domain (#2050)

This commit is contained in:
J. Nick Koston 2024-01-23 12:41:23 -10:00 committed by GitHub
parent 3626c91374
commit 8d6ca7126f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)`.