def _find_device()

in smart-mirror-full/extracted/device/script/src/agt/base_adapter.py [0:0]


    def _find_device(self, bd_addr):
        objs = self._dbus.Interface(self._bus.get_object(BUS_NAME, '/'), DBUS_OM_IFACE).GetManagedObjects()
        for path, _interface in objs.items():
            device = _interface.get(DEVICE_INTERFACE)
            if device is None:
                continue
            if device['Address'] == bd_addr:
                return self._dbus.Interface(self._bus.get_object(BUS_NAME, path), DEVICE_INTERFACE)
        return None