From c3b9b9535c92e6ccca61a300d5dd1c5364e1c375 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 5 Feb 2026 13:00:35 +0100 Subject: [PATCH] Fix RAUC D-Bus type annotations for runtime type checking (#6532) Replace ctypes integer types (c_uint32, c_uint64) with standard Python int in SlotStatusDataType to satisfy typeguard runtime type checking. D-Bus returns standard Python integers, not ctypes objects. Also fix the mark() method return type from tuple[str, str] to list[str] to match the actual D-Bus return value, and add missing optional fields "bundle.hash" and "installed.transaction" to SlotStatusDataType. Co-authored-by: Claude Sonnet 4.5 --- supervisor/dbus/rauc.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/supervisor/dbus/rauc.py b/supervisor/dbus/rauc.py index 643987aac..b22a94f6f 100644 --- a/supervisor/dbus/rauc.py +++ b/supervisor/dbus/rauc.py @@ -1,6 +1,5 @@ """D-Bus interface for rauc.""" -from ctypes import c_uint32, c_uint64 import logging from typing import Any, NotRequired, TypedDict @@ -33,13 +32,15 @@ SlotStatusDataType = TypedDict( "state": str, "device": str, "bundle.compatible": NotRequired[str], + "bundle.hash": NotRequired[str], "sha256": NotRequired[str], - "size": NotRequired[c_uint64], - "installed.count": NotRequired[c_uint32], + "size": NotRequired[int], + "installed.count": NotRequired[int], + "installed.transaction": NotRequired[str], "bundle.version": NotRequired[str], "installed.timestamp": NotRequired[str], "status": NotRequired[str], - "activated.count": NotRequired[c_uint32], + "activated.count": NotRequired[int], "activated.timestamp": NotRequired[str], "boot-status": NotRequired[str], "bootname": NotRequired[str], @@ -117,7 +118,7 @@ class Rauc(DBusInterfaceProxy): return self.connected_dbus.signal(DBUS_SIGNAL_RAUC_INSTALLER_COMPLETED) @dbus_connected - async def mark(self, state: RaucState, slot_identifier: str) -> tuple[str, str]: + async def mark(self, state: RaucState, slot_identifier: str) -> list[str]: """Get slot status.""" return await self.connected_dbus.Installer.call("mark", state, slot_identifier)