From 717fd5740bda28003baf1470ee77871131537b88 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Mon, 11 Nov 2024 14:09:05 +0000 Subject: [PATCH] Improve repair typing --- custom_components/battery_notes/repairs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/battery_notes/repairs.py b/custom_components/battery_notes/repairs.py index 4cdfb1bda..11c894a41 100644 --- a/custom_components/battery_notes/repairs.py +++ b/custom_components/battery_notes/repairs.py @@ -12,7 +12,7 @@ class MissingDeviceRepairFlow(RepairsFlow): """Handler for an issue fixing flow.""" - def __init__(self, data: dict[str, str]) -> None: + def __init__(self, data: dict[str, str | int | float | None] | None) -> None: """Initialize.""" self.entry_id = data["entry_id"] self.device_id = data["device_id"] @@ -55,3 +55,4 @@ async def async_create_fix_flow( if issue_id.startswith("missing_device_"): assert data return MissingDeviceRepairFlow(data) + raise ValueError(f"unknown repair {issue_id}")