Add path to exceptions in IQS action-exceptions.md (#2468)

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
epenet 2024-11-22 12:18:50 +01:00 committed by GitHub
parent b385a5fec9
commit 23d946d7fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,9 @@ When the problem is caused by an error in the service action itself (for example
In this example, we show a function that is registered as a service action in Home Assistant.
If the input is incorrect (when the end date is before the start date), a `ServiceValidationError` is raised, and if we can't reach the service, we raise a `HomeAssistantError`.
```python {6,10} showLineNumbers
```python {8,12} showLineNumbers
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
async def async_set_schedule(call: ServiceCall) -> ServiceResponse:
"""Set the schedule for a day."""
start_date = call.data[ATTR_START_DATE]