Commit Graph
4 Commits
Author SHA1 Message Date
Antoine Prieels bb04da8f64 [FIX] hw_drivers: Traceback in 'device_changed'
Only the 'action' requests have the 'data' parameter set, so any other
request triggering a 'device_changed' failed.

closes odoo/odoo#66826

X-original-commit: 0850814dda9802973e48ef89d6a81d61fc36a646
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2021-02-25 11:49:13 +00:00
Antoine Prieels e5ffccdb28 [IMP] hw_drivers: Add action data in IoT events
Add all the request data in events triggered by IoT actions.

closes odoo/odoo#61798

Taskid: 2320958
X-original-commit: a8c56602ba8301b6e901be7ffeaa219d77401f79
Related: odoo/enterprise#14763
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-11-16 16:01:22 +00:00
Antoine Prieels f3b5bf6b3f [FIX] hw_drivers: Lost IoT events
Events coming from the IoT Box were lost in two cases:

1. Create a listener for device 1
2. Send an action to device 1
--> If the action arrives before the listener the event is never sent
to the DB

1. Setup up two listeners for devices 1 & 2
2. After a few seconds, send two consecutive actions to devices 1 & 2
--> Everytime a longpolling request arrives, a new threading.Event
object is created. The first action sets the event, then, before the
new longpolling request arrives, the second action sets the same event,
which is overwritten once the new longpolling request arrives.

We now maintain a list of events, and when a longpolling request
arrives on the IoT Box, we make sure that all events that occured in
the last 5 seconds were received by the DB. If no events were pending,
we wait 50 seconds to check if a new one pops up.

Taskid: 2320958
X-original-commit: e3260712ce96a8d81bf807574c334d92c37c6ae4
2020-11-16 16:01:21 +00:00
Antoine Prieels 72681dc53f [IMP] hw_*,point_of_sale: Cleaning IoT Box
- Split driver.py to multiple files
- Remove hw_proxy module as most of its routes were not used and
  move remaingin routes to a controller in hw_drivers
- Add missing coding and license lines at the beginning of files
- Reorder imports and remove unused ones
- Rename device_id to device_identifier for clarity
- Rename screen to display for consistency
- Other minors improvements

Taskid: 1973956
X-original-commit: 841c016913a87133bf7257c62ae5f6bf7d99e06d
2020-08-25 11:24:56 +00:00