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:
7
fusion_iot/iot/static/src/img/unsupported.svg
Normal file
7
fusion_iot/iot/static/src/img/unsupported.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M58.6886 16.595L32.8244 1.46649L5.31143 17.349L31.2461 32.4775L58.6886 16.595Z" fill="#FBDBD0"/>
|
||||
<path d="M31.2461 62.5335L5.31143 47.405V17.3489L31.2461 32.4775V62.5335Z" fill="#C1DBF6"/>
|
||||
<path d="M31.2461 62.5335L58.6886 46.6511V16.595L31.2461 32.4775V62.5335Z" fill="white"/>
|
||||
<path d="M32.7539 1.46647L58.6886 16.595V46.6511L31.2461 62.5335L5.31144 47.405V17.3489L32.7539 1.46647ZM32.7557 0.409058L4.39716 16.8217V47.9301L31.2443 63.5909L59.6029 47.1783V16.0699L32.7557 0.409058Z" fill="#374874"/>
|
||||
<path d="M44.0935 43.3884V42.3057C44.0935 41.7879 44.1648 41.2799 44.3075 40.7817C44.4502 40.2757 44.6744 39.7579 44.9802 39.2283C45.2859 38.6987 45.6698 38.1397 46.1318 37.5513C46.5259 37.0413 46.8418 36.5843 47.0796 36.1803C47.3242 35.7645 47.5009 35.3644 47.6096 34.9799C47.7183 34.5955 47.7727 34.1954 47.7727 33.7796V33.756C47.7727 33.2696 47.6708 32.8969 47.4669 32.638C47.2631 32.3791 46.9743 32.2477 46.6006 32.2438C46.2269 32.2399 45.7853 32.385 45.2757 32.6792C44.7661 32.9734 44.3211 33.3402 43.9406 33.7796C43.5601 34.2189 43.2578 34.7073 43.0336 35.2447C42.8161 35.7782 42.6904 36.3333 42.6565 36.9099L42.6361 36.9335L40.9035 37.9455V37.922C40.9443 37.059 41.1345 36.1842 41.4742 35.2977C41.814 34.4111 42.3066 33.5775 42.952 32.7969C43.5975 32.0163 44.3958 31.3514 45.3471 30.8022C46.2032 30.3079 46.9539 30.0627 47.5994 30.0667C48.2517 30.0588 48.7579 30.2726 49.118 30.708C49.4849 31.1317 49.6683 31.7476 49.6683 32.5557V32.5792C49.6683 33.4971 49.4747 34.4013 49.0874 35.2918C48.7069 36.1705 48.1905 37.0257 47.5383 37.8573C47.1102 38.3947 46.7739 38.8674 46.5293 39.2754C46.2915 39.6794 46.1216 40.0638 46.0197 40.4287C45.9246 40.7896 45.877 41.1779 45.877 41.5937V42.3587L44.0935 43.3884ZM45.1228 48.2546C44.7084 48.4939 44.3687 48.537 44.1037 48.384C43.8387 48.231 43.7062 47.9153 43.7062 47.4367C43.7062 46.9503 43.8387 46.4776 44.1037 46.0186C44.3687 45.5596 44.7084 45.2105 45.1228 44.9712C45.5373 44.7319 45.8736 44.6907 46.1318 44.8477C46.3968 45.0006 46.5293 45.3203 46.5293 45.8068C46.5293 46.2853 46.3968 46.7541 46.1318 47.2131C45.8736 47.6681 45.5373 48.0153 45.1228 48.2546Z" fill="#374874"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
Reference in New Issue
Block a user