Replace stub method query() in DeviceProvider with real implementation