Taking input from devices
The IoT Box only supports limited devices. Right now, these hardware devices are integrated with the manufacturing application. But if you want, you can integrate supported devices with your module. In this recipe, we will capture a picture from a camera through our IoT Box.
Getting ready
We will be using the my_library
module from the Logging user changes in a chatter recipe of Chapter 23, Managing Emails in Odoo. In this recipe, we will add a new field to capture and store images when a borrower returns a book. Make sure the IoT Box is on and that you have connected a supported camera device with it.
How to do it...
Perform the following steps to capture a picture using a camera with the IoT Box:
- Add a dependency in the manifest file:
... 'depends': ['base', 'mail', 'quality_iot'], ...
- Add new fields in the
library.book.rent
model:... device_id = fields.Many2one('iot.device', string...