Update 2025-06-03-deprecate-verify-domain-control.md

This commit is contained in:
epenet 2025-06-03 09:32:35 +02:00 committed by GitHub
parent dbc3b1283e
commit e2389036aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,16 +14,16 @@ a reference to `HomeAssistant` is available as a property of the `ServiceCall` o
and it became redundant to pass `hass` object to `verify_domain_control`. and it became redundant to pass `hass` object to `verify_domain_control`.
To update your integration: To update your integration:
1. Replace the decorator as shown in the first example below 1. Replace the decorator (as shown in the first example below).
2. (Optional) Move the nested functions to be module-level as shown in the second example below 2. Move the nested functions to be module-level (Optional - as shown in the second example below).
3. Test the changes 3. Test the changes.
The old `verify_domain_control` function will be removed in Home Assistant 2026.7. The old `verify_domain_control` function will be removed in Home Assistant 2026.7.
### Examples ### Examples
Minimum change is to simply adjust the decorator The minimum change is to adjust the decorator
```python ```python
# Old # Old
@ -44,7 +44,7 @@ def register_services(hass: HomeAssistant) -> None:
hass.services.async_register(...) hass.services.async_register(...)
``` ```
To reduce code complexity, it is now recommended to move the service functions to be module-level functions Move the service functions to module-level functions to reduce code complexity.
```python ```python
# Old # Old