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:
17
fusion_iot/iot/static/src/img/pairing_code.svg
Normal file
17
fusion_iot/iot/static/src/img/pairing_code.svg
Normal file
@@ -0,0 +1,17 @@
|
||||
<svg width="128" height="128" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M54.5 5L52 3L14.5 24L10 27.5V59.5L12 60L53 36.5L54 35.5L54.5 33.5V5Z" fill="white"/>
|
||||
<path d="M36.3546 48.4447C36.3546 50.2759 37.6403 51.0181 39.2262 50.1025L40.9059 49.1327C41.0687 49.0388 41.2159 49.0293 41.324 49.0884C41.3223 49.0842 41.3211 49.0814 41.3211 49.0814L37.8482 47.3471L36.3546 48.2095V48.4447Z" fill="#FBDBD0"/>
|
||||
<path d="M23.3837 59.9418C23.3837 59.5593 23.6523 59.0941 23.9836 58.9028L25.6633 57.9331C27.2492 57.0174 28.5349 54.7905 28.5349 52.9593V50.211L25.3957 51.9709C25.0919 53.6123 23.9469 55.3731 22.5876 56.1579L21.0277 57.0585C20.6891 57.254 20.348 58.1707 20.348 58.1707C20.348 58.1707 23.3332 60.2462 23.5506 60.3269C23.5524 60.3275 23.554 60.3267 23.5558 60.3271C23.4496 60.2635 23.3837 60.1307 23.3837 59.9418Z" fill="#FBDBD0"/>
|
||||
<path d="M36.3546 38.0491V48.4446C36.3546 50.2759 37.6403 51.0181 39.2262 50.1025L40.9059 49.1327C41.2372 48.9415 41.653 49.0868 41.653 49.4693C41.653 49.8519 41.837 50.0198 41.5057 50.2111L23.9836 60.2881C23.6523 60.4794 23.3837 60.3244 23.3837 59.9418C23.3837 59.5593 23.6523 59.0941 23.9836 58.9028L25.6632 57.9331C27.2492 57.0175 28.5348 54.7906 28.5348 52.9593V42.5638L36.3546 38.0491Z" fill="white"/>
|
||||
<path d="M12.5025 56.2704L52.387 33.243C52.6249 33.1057 52.8177 32.7373 52.8177 32.4202V5.63051C52.8177 5.31336 52.6249 5.16758 52.387 5.30493L12.5025 28.3322C12.2646 28.4696 12.0718 28.838 12.0718 29.1551V55.9448C12.0718 56.262 12.2646 56.4077 12.5025 56.2704Z" fill="#374874"/>
|
||||
<path d="M31.0014 47.4545L33.8881 45.7879C34.0169 45.7135 34.1214 45.5138 34.1214 45.342C34.1214 45.1701 34.0169 45.0912 33.8881 45.1656L31.0014 46.8322C30.8725 46.9066 30.768 47.1062 30.768 47.2781C30.768 47.45 30.8725 47.5289 31.0014 47.4545Z" fill="#150035"/>
|
||||
<path d="M30.9083 47.6548C30.9674 47.6548 31.0286 47.6378 31.0876 47.6037L33.9742 45.9372C34.1564 45.8319 34.2937 45.5761 34.2937 45.3421C34.2937 45.1886 34.2329 45.0654 34.127 45.0041C34.0305 44.948 33.9123 44.9528 33.8021 45.016L30.9153 46.6829C30.7331 46.7882 30.5957 47.044 30.5957 47.278C30.5957 47.4317 30.6566 47.5549 30.7625 47.616C30.8074 47.642 30.8569 47.6548 30.9083 47.6548Z" fill="#374874"/>
|
||||
<path d="M8.42326 28.4831V56.9832C8.42326 57.5505 8.60032 57.9598 8.88397 58.1615C10.2481 59.3392 11.4531 59.6696 11.4551 59.6701C11.0939 59.5115 10.8598 59.0686 10.8598 58.4163V29.9164C10.8598 29.2847 11.0787 28.5956 11.4204 28.0298L8.88884 26.764C8.60246 27.2952 8.42326 27.9125 8.42326 28.4831Z" fill="#C1DBF6"/>
|
||||
<path d="M51.0473 2.3265C51.0427 2.324 51.0378 2.32234 51.0332 2.31994C51.0308 2.31888 51.0285 2.31786 51.0261 2.31671L51.0259 2.31692C50.768 2.19091 50.4416 2.21395 50.0858 2.41948L9.93055 25.6031C9.52603 25.8367 9.15954 26.2619 8.88879 26.764L11.4204 28.0298C11.6792 27.6013 12.0083 27.2435 12.3671 27.0363L52.5224 3.85262C52.906 3.63123 53.255 3.62227 53.521 3.78332C53.521 3.78332 52.5086 2.98117 51.0473 2.3265Z" fill="#FBDBD0"/>
|
||||
<path d="M50.0858 2.41953L52.5224 3.85267L54.0297 4.99219V33.4923C54.0297 34.6021 53.3548 35.8915 52.5224 36.3721L36.3546 45.7067V48.2095L37.8483 47.3471C37.8483 47.3471 41.3214 49.0874 41.3214 49.0874C41.4347 49.1481 41.837 50.0198 41.5057 50.2111C41.5057 50.2111 23.7783 60.326 23.5556 60.326C23.5549 60.326 23.5544 60.3259 23.554 60.3257C23.5539 60.3256 20.348 58.1708 20.348 58.1708C20.348 58.1708 20.6891 57.254 21.0277 57.0585L22.5876 56.158C23.9272 55.3845 25.0569 53.6634 25.3802 52.0427L12.3671 59.5559C12.1557 59.6779 11.9549 59.7352 11.7727 59.7352C11.6589 59.7352 11.5523 59.7129 11.4549 59.67C11.4482 59.6681 10.2453 59.3369 8.88397 58.1615C8.60032 57.9598 8.42327 57.5505 8.42327 56.9832V28.4831C8.42327 27.9125 8.60242 27.2952 8.8888 26.7641C9.15954 26.262 9.52603 25.8367 9.93056 25.6031L50.0858 2.41953ZM50.0901 1.36127L49.6287 1.62778L9.47341 24.8114C8.93924 25.1197 8.44583 25.6591 8.08402 26.3301C7.71319 27.018 7.50896 27.7825 7.50896 28.483V56.9831C7.50896 57.8147 7.79431 58.4849 8.31385 58.8771C9.65067 60.0228 10.8486 60.4407 11.1507 60.5334C11.3473 60.6105 11.5562 60.6494 11.7727 60.6494C12.1234 60.6494 12.4772 60.548 12.824 60.3479L23.3383 54.2773C22.9762 54.7356 22.5607 55.1177 22.1304 55.3662L20.5705 56.2666C20.0551 56.5644 19.699 57.2931 19.4911 57.8519L19.2397 58.5274L19.8379 58.9296C22.5182 60.7311 22.9768 61.0393 23.0717 61.1015L23.0713 61.1021L23.293 61.2399L23.5556 61.2403C23.7617 61.2403 24.8769 60.6746 26.901 59.5432C28.4005 58.7035 30.4744 57.5328 33.0651 56.0638C37.4749 53.5634 41.9145 51.0305 41.9588 51.0051C42.3423 50.7837 42.5556 50.3805 42.548 49.8965C42.5416 49.4915 42.2949 48.572 41.7535 48.2817L41.4268 48.1065L41.4126 48.1105C40.5552 47.6809 38.2578 46.5297 38.2578 46.5297L37.8176 46.3091L37.3911 46.5554L37.2689 46.6259V46.2346L52.9795 37.1639C54.0994 36.5174 54.944 34.939 54.944 33.4923V4.53727L54.581 4.26282L53.0737 3.1233L53.0315 3.09139L52.9859 3.0646L50.5494 1.63146L50.0901 1.36127Z" fill="#374874"/>
|
||||
<path d="M23.3134 34.0182V41.2909L22.5585 41.7445V35.395L22.522 35.417L21 37.5104V36.6156L22.5585 34.4717L23.3134 34.0182Z" fill="white"/>
|
||||
<path d="M25.1062 40.2136V39.5744L27.1639 35.7102C27.4054 35.2573 27.6043 34.8703 27.7605 34.5492C27.9168 34.2256 28.0325 33.9407 28.1075 33.6943C28.1847 33.4444 28.2232 33.2082 28.2232 32.9856C28.2232 32.73 28.1705 32.5403 28.0649 32.4167C27.9614 32.2918 27.8194 32.2328 27.6388 32.2395C27.4582 32.2462 27.2553 32.3173 27.03 32.4526C26.7905 32.5965 26.5815 32.7801 26.403 33.0034C26.2264 33.2231 26.0894 33.4652 25.992 33.7297C25.8966 33.993 25.849 34.2631 25.849 34.5401L25.1306 34.9717C25.1306 34.5456 25.2148 34.1209 25.3832 33.6978C25.5517 33.2746 25.781 32.8858 26.0712 32.5316C26.3634 32.1761 26.6911 31.8892 27.0544 31.6709C27.4196 31.4514 27.7433 31.3469 28.0254 31.3574C28.3074 31.3678 28.5286 31.4776 28.6889 31.6866C28.8492 31.8957 28.9294 32.1873 28.9294 32.5613C28.9294 32.8288 28.8878 33.1154 28.8046 33.4211C28.7234 33.7232 28.5814 34.0915 28.3785 34.5259C28.1776 34.9567 27.8985 35.5032 27.5414 36.1652L26.1412 38.7537V38.8105L29.039 37.0693V37.8506L25.1062 40.2136Z" fill="white"/>
|
||||
<path d="M32.4025 35.929C32.0007 36.1704 31.6426 36.3051 31.328 36.3332C31.0155 36.3599 30.7669 36.2856 30.5823 36.1101C30.3996 35.931 30.3002 35.6558 30.2839 35.2844L31.051 34.8235C31.0673 35.0481 31.1362 35.209 31.258 35.3063C31.3798 35.4013 31.5391 35.4358 31.7359 35.4098C31.9327 35.3839 32.1509 35.299 32.3903 35.1551C32.6582 34.9941 32.8956 34.797 33.1026 34.5637C33.3096 34.3305 33.4719 34.0814 33.5896 33.8166C33.7073 33.5517 33.7662 33.2914 33.7662 33.0358C33.7662 32.7682 33.7094 32.5668 33.5957 32.4315C33.4821 32.2938 33.3157 32.2328 33.0965 32.2485C32.8774 32.2642 32.6095 32.3671 32.2929 32.5574L31.7937 32.8573V32.0761L32.2929 31.7761C32.5405 31.6273 32.7576 31.4448 32.9443 31.2285C33.1331 31.0109 33.2802 30.7757 33.3857 30.5229C33.4933 30.2689 33.547 30.014 33.547 29.7584C33.547 29.5121 33.5004 29.3259 33.407 29.1997C33.3137 29.0735 33.1818 29.0107 33.0113 29.0114C32.8429 29.0108 32.644 29.0794 32.4147 29.2171C32.1996 29.3464 31.9967 29.5145 31.8059 29.7214C31.6172 29.9248 31.463 30.1489 31.3432 30.3936C31.2235 30.636 31.1586 30.881 31.1484 31.1286L30.4179 31.5675C30.4301 31.179 30.5285 30.7861 30.7131 30.3887C30.8978 29.9889 31.1393 29.6189 31.4376 29.2787C31.7379 28.9372 32.0677 28.6586 32.4269 28.4428C32.8124 28.2111 33.1432 28.1035 33.4192 28.12C33.6952 28.1341 33.9072 28.2446 34.0554 28.4515C34.2035 28.6584 34.2776 28.9335 34.2776 29.2768C34.2776 29.6864 34.1852 30.091 34.0006 30.4908C33.8179 30.8894 33.5694 31.2388 33.2548 31.5391V31.5959C33.6485 31.4351 33.9559 31.4457 34.1771 31.6276C34.3983 31.8072 34.5089 32.1278 34.5089 32.5895C34.5089 32.9849 34.4166 33.3954 34.2319 33.8213C34.0493 34.2435 33.7997 34.6397 33.4831 35.0098C33.1665 35.38 32.8063 35.6864 32.4025 35.929Z" fill="white"/>
|
||||
<path d="M35.6078 32.4122V31.6878L38.3473 24.9849L38.7978 24.7142V25.8363L38.4934 26.0192L36.4235 31.084V31.1408L40.1128 28.9241V29.7053L35.6078 32.4122ZM38.5421 32.1405V24.8678L39.2605 24.4362V31.7089L38.5421 32.1405Z" fill="white"/>
|
||||
<path d="M43.2016 29.4403C42.8444 29.6549 42.5228 29.7653 42.2367 29.7715C41.9505 29.7777 41.7212 29.6882 41.5487 29.503C41.3762 29.3178 41.2819 29.0455 41.2656 28.6859L41.9962 28.2469C42.0246 28.5589 42.1524 28.7544 42.3797 28.8332C42.609 28.9085 42.883 28.8505 43.2016 28.659C43.4573 28.5054 43.6845 28.299 43.8834 28.0398C44.0843 27.7794 44.2416 27.4932 44.3552 27.181C44.4709 26.8653 44.5287 26.5524 44.5287 26.2423C44.5287 25.925 44.4689 25.6781 44.3491 25.5015C44.2314 25.3212 44.0691 25.2211 43.8621 25.2011C43.6551 25.181 43.4187 25.2497 43.1529 25.407C42.9621 25.5193 42.7663 25.6713 42.5654 25.863C42.3645 26.0524 42.1991 26.2405 42.0692 26.4275L41.3631 26.7524L41.7405 22.946L44.9792 21V21.7812L42.3736 23.3468L42.1545 25.6234L42.191 25.6015C42.3188 25.4063 42.4792 25.2117 42.6719 25.0178C42.8647 24.8238 43.0656 24.664 43.2746 24.5384C43.6561 24.3092 43.996 24.2115 44.2943 24.2453C44.5947 24.2756 44.8301 24.423 45.0005 24.6875C45.173 24.9508 45.2593 25.318 45.2593 25.7891C45.2593 26.2531 45.17 26.7211 44.9914 27.193C44.8149 27.6613 44.5713 28.094 44.2609 28.4913C43.9504 28.8862 43.5973 29.2025 43.2016 29.4403Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.0 KiB |
Reference in New Issue
Block a user