From 23d946d7fd579b43f1988ad2c949d3db0bad1fb1 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 22 Nov 2024 12:18:50 +0100 Subject: [PATCH] Add path to exceptions in IQS action-exceptions.md (#2468) Co-authored-by: Joost Lekkerkerker --- .../integration-quality-scale/rules/action-exceptions.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/core/integration-quality-scale/rules/action-exceptions.md b/docs/core/integration-quality-scale/rules/action-exceptions.md index 9f5a7768..c9082ca6 100644 --- a/docs/core/integration-quality-scale/rules/action-exceptions.md +++ b/docs/core/integration-quality-scale/rules/action-exceptions.md @@ -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] @@ -44,4 +46,4 @@ There are no exceptions to this rule. ## Related rules - \ No newline at end of file +