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.
This commit is contained in:
Ryan Malloy 2026-02-02 20:48:19 -07:00
parent 9d1c0f3e0f
commit f6b2ac40fb

View File

@ -569,7 +569,7 @@ class BlueZClient:
""" """
iface = await self._get_interface(char_path, BLUEZ_GATT_CHAR_IFACE) iface = await self._get_interface(char_path, BLUEZ_GATT_CHAR_IFACE)
options = {"type": Variant("s", write_type)} 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: async def start_notify(self, char_path: str) -> None:
"""Start notifications for a characteristic.""" """Start notifications for a characteristic."""