From f6b2ac40fb2b44012357064ed349e3c241030f51 Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Mon, 2 Feb 2026 20:48:19 -0700 Subject: [PATCH] Fix bt_ble_write: use bytearray instead of list for D-Bus WriteValue dbus_fast maps BlueZ's WriteValue 'ay' parameter to bytearray internally. Passing list(value) caused "can't concat list to bytearray" when the library tried to serialize the argument. --- src/mcbluetooth/dbus_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mcbluetooth/dbus_client.py b/src/mcbluetooth/dbus_client.py index 4536f86..c3cc5ea 100644 --- a/src/mcbluetooth/dbus_client.py +++ b/src/mcbluetooth/dbus_client.py @@ -569,7 +569,7 @@ class BlueZClient: """ iface = await self._get_interface(char_path, BLUEZ_GATT_CHAR_IFACE) options = {"type": Variant("s", write_type)} - await iface.call_write_value(list(value), options) + await iface.call_write_value(bytearray(value), options) async def start_notify(self, char_path: str) -> None: """Start notifications for a characteristic."""