feat(iot): repackaged Odoo iot modules + Fusion Plating sensor wrapper

Phase A of the IoT initiative — gets the server-side infrastructure
in place before the Raspberry Pi hardware arrives, so the iot admin
UI + /fp/iot/ingest endpoint are ready to accept the first real
temperature reading as soon as the Pi is wired up.

New top-level folder: fusion_iot/

1. **iot_base/** — Odoo S.A. iot_base module, copied from
   RePackaged-Odoo verbatim. LGPL-3 upstream, no changes needed.

2. **iot/** — Odoo S.A. iot module, repackaged:
   - `models/update.py` neutralised (removed the publisher_warranty
     IoT-Box-counting report that phones home to odoo.com for
     enterprise licence enforcement)
   - `iot_handlers/lib/load_worldline_library.sh` deleted (proprietary
     Worldline payment lib fetch from download.odoo.com, not needed)
   - `wizard/add_iot_box.py._connect_iot_box_with_pairing_code` —
     upstream called odoo.com's iot-proxy to resolve pairing codes;
     replaced with a no-op. Pi-side iot_drivers proxy registers
     directly with this Odoo server instead.
   - Manifest rebranded with an explicit changelog preamble.

3. **fusion_plating_iot/** — new plating-specific wrapper:
   - `fp.tank.sensor` — maps an iot.device (or a direct-HTTP-ingest
     sensor) to a fusion.plating.tank + fusion.plating.bath.parameter.
     Supports DS18B20, PT100/1000, pH, conductivity, level. Per-sensor
     alert_min/max overrides.
   - `fp.tank.reading` — append-only time-series. On create, evaluates
     against sensor's alert range. On in-spec → out-of-spec TRANSITION,
     auto-raises a fusion.plating.quality.hold (once per excursion,
     no spam during sustained out-of-spec).
   - `POST /fp/iot/ingest` — shared-secret HTTP endpoint for sensors
     bypassing the Pi proxy. Token via X-FP-IOT-Token header OR body.
     Accepts single-reading or batch payloads.
   - Menu under Plating → Operations → Sensors & Readings.
   - Tank form inherits get a Sensors tab inline.

Deployed to entech. Verified end-to-end:
- Install: iot_base + iot + fusion_plating_iot all 'installed'
- Smoke test: in-spec → out-of-spec → hold raised (HOLD-0010);
  continued excursion → NO duplicate hold; back-in-spec → NEW
  excursion → NEW hold (HOLD-0011) ✓
- HTTP endpoint: correct token → 200 accepted; wrong token → 401;
  unknown device_serial → 404; batch payload → 200 accepted=N ✓

Phase B (when Raspberry Pi hardware arrives): DS18B20 iot_handler
driver for the Pi-side iot_drivers proxy + systemd service on
vanilla Raspberry Pi OS + first live reading from physical probe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-19 10:46:45 -04:00
parent c118b7c6b5
commit 6e964c230f
419 changed files with 76449 additions and 0 deletions

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="b" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 280 280"><g id="m"><g><polygon points="256.7625 72.6032 143.6068 6.4158 23.2375 75.9016 136.7016 142.089 256.7625 72.6032" style="fill:#fff;"/><polygon points="136.7016 273.5842 23.2375 207.3968 23.2375 75.9016 136.7016 142.089 136.7016 273.5842" style="fill:#c1dbf6; stroke:#c1dbf6; stroke-miterlimit:10;"/><polygon points="136.7016 273.5842 256.7625 204.0984 256.7625 72.6032 136.7016 142.089 136.7016 273.5842" style="fill:#fff;"/><polygon points="206.4073 43.3576 87.226 113.2832 103.2781 122.7385 222.8992 53.0328 206.4073 43.3576" style="fill:#fbdbd0;"/><polygon points="204.5382 42.588 188.8254 32.9127 69.644 102.8383 85.6961 112.2936 204.5382 42.588" style="fill:#fbdbd0;"/><line x1="87.226" y1="112.2936" x2="204.5382" y2="42.588" style="fill:none; stroke:#374874; stroke-linecap:round; stroke-miterlimit:10; stroke-width:2px;"/><path d="m90.0846,164.5179l-34.3031-19.5703c-3.7382-2.1989-6.157-6.157-6.157-10.5548h0c0-4.8376,5.2774-7.9161,9.4554-5.4973l36.2821,20.8897c3.0785,1.7591,5.0575,5.2774,5.0575,8.7957h0c.2199,5.2774-5.7172,8.5758-10.3349,5.9371Z" style="fill:#374874; stroke:#374874; stroke-miterlimit:10; stroke-width:1.7657px;"/><path d="m143.2984,6.4158l113.4641,66.1874v131.4952l-120.0609,69.4858L23.2375,207.3968V75.9015L143.2984,6.4158m.0079-4.6262l-2.0116,1.1642L21.2339,72.4396l-1.9964,1.1554v136.0993l1.9845,1.1577,113.4641,66.1874,2.0076,1.171,2.0116-1.1642,120.0609-69.4858,1.9964-1.1554V70.3057l-1.9845-1.1577L145.3139,2.9607l-2.0076-1.1711h0Z" style="fill:#374874;"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB