Files
Odoo-Modules/fusion_iot/fusion_plating_iot/__manifest__.py
gsinghpal a7fd39d6f3 feat(iot): Sub 7 — per-sensor polling interval + rate-limit + entech seed
Per-sensor override on fp.tank.sensor.poll_interval_minutes with a
company-wide default (res.company.x_fc_default_poll_interval_minutes,
default 30) exposed in Settings → Fusion Plating → IoT. Single
lookup helper _fp_effective_poll_interval_minutes keeps downstream
call sites simple. Read-only poll_interval_display Char ("30 min
(default)" / "15 min (override)") keeps units unambiguous per user
request.

Ingest endpoint /fp/iot/ingest drops readings that arrive inside a
sensor's effective interval, returning {accepted, skipped} so the Pi
agent can log it. Pi-side interval stays its own concern.

Post-init hook seeds 5 small tanks + 20 big tanks (10 active, 10
inactive) with 1 temperature + 1 pH sensor each → 25 tanks, 50
sensors. Idempotent (keyed by tank.code, with_context(active_test=
False)). Opt-in via ir.config_parameter
fusion_plating_iot.seed_entech_tanks = '1' so a fresh install
elsewhere doesn't auto-seed. Flag set on entech today; 27 tanks / 52
sensors now live (2 pilot + 25 seeded).

Smoke on entech: 14/14 assertions pass including idempotency and
rate-limit conditions.

fusion_plating_iot → 19.0.2.0.0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 23:29:08 -04:00

62 lines
2.1 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
# Part of the Fusion Plating product family.
{
'name': 'Fusion Plating — IoT Integration',
'version': '19.0.2.0.0',
'category': 'Manufacturing/Plating',
'summary': 'Wire physical tank sensors to Fusion Plating — live '
'temperature / chemistry readings with auto quality holds '
'on out-of-spec.',
'description': """
Fusion Plating — IoT Integration
================================
Bridges the generic `iot` module (IoT Box + device management) to
plating-specific models:
* ``fp.tank.sensor`` — maps an ``iot.device`` to a
``fusion.plating.tank`` (or a ``fusion.plating.bath``).
* ``fp.tank.reading`` — time-series log of every sensor reading.
* Auto-creates a ``fusion.plating.quality.hold`` when a reading
falls outside the tank/bath's target range (per
``fusion.plating.bath.parameter`` spec).
Supports both the Odoo-IoT proxy path (Pi running iot_drivers) AND
a direct HTTP ingest path (``/fp/iot/ingest``) for sensors that
skip the proxy and POST straight to Odoo with a shared secret.
Part of the Fusion Plating product family by Nexa Systems Inc.
""",
'author': 'Nexa Systems Inc.',
'website': 'https://www.nexasystems.ca',
'maintainer': 'Nexa Systems Inc.',
'support': 'support@nexasystems.ca',
'license': 'OPL-1',
'price': 0.00,
'currency': 'CAD',
'depends': [
'iot',
'fusion_plating',
'fusion_plating_quality',
],
'data': [
'security/ir.model.access.csv',
'data/ir_config_parameter_data.xml',
'data/fp_sensor_type_data.xml',
'views/fp_sensor_type_views.xml',
'views/fp_sensor_dashboard_views.xml',
'views/fp_tank_sensor_views.xml',
'views/fp_tank_reading_views.xml',
'views/fusion_plating_tank_views.xml',
'views/res_config_settings_views.xml',
'views/fp_iot_menu.xml',
],
'post_init_hook': 'post_init_hook',
'installable': True,
'application': False,
'auto_install': False,
}