Linux と Python で Bluetooth Device Address を取得するときのメモ。
import dbus
BLUEZ_SERVICE_NAME = 'org.bluez'
DBUS_OM_IFACE = 'org.freedesktop.DBus.ObjectManager'
DBUS_PROP_IFACE = 'org.freedesktop.DBus.Properties'
bus = dbus.SystemBus()
adapter = dbus.Interface(bus.get_object(BLUEZ_SERVICE_NAME, '/org/bluez/hci0'),
DBUS_PROP_IFACE)
addr = adapter.Get("org.bluez.Adapter1", "Address")
print(addr)