python: Change device to device_id