fix: session-login auth + remove session_id unique constraint (1.5.0)

- odoo_client: session-based auth via /web/session/authenticate
  for multi-database Odoo (no db_name/dbfilter required)
- mqtt_session: remove UNIQUE(device_id, session_id) constraint –
  device session_id is a local counter that resets on restart
- iot_api: revert upsert workaround (no longer needed)
- bump versions: iot_bridge 1.4.0 → 1.5.0, open_workshop_mqtt 18.0.1.4.0 → 18.0.1.5.0
This commit is contained in:
Matthias Lotz 2026-03-21 10:57:10 +01:00
parent f5cd442770
commit 0d01b69dcd
4 changed files with 7 additions and 8 deletions

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
{
'name': 'Open Workshop MQTT',
'version': '18.0.1.4.0',
'version': '18.0.1.5.0',
'category': 'IoT',
'summary': 'MQTT IoT Device Integration for Workshop Equipment Tracking',
'description': """

View File

@ -267,10 +267,9 @@ class MqttSession(models.Model):
session.duration_formatted = f"{seconds}s"
# ========== Constraints ==========
_sql_constraints = [
('session_id_unique', 'UNIQUE(session_id)',
'Session ID must be unique!'),
]
# Note: session_id is a device-local counter that resets on device restart.
# Therefore neither session_id alone nor (device_id, session_id) is globally
# unique. Idempotency is guaranteed at the event level via event_uid.
@api.constrains('start_time', 'end_time')
def _check_times(self):

View File

@ -34,7 +34,7 @@ class ConfigServer:
self.app = FastAPI(
title="IoT Bridge Config API",
description="Receives device configuration from Odoo",
version="1.4.0",
version="1.5.0",
)
self.config_callback = config_callback
self.mqtt_reconnect_callback = mqtt_reconnect_callback
@ -103,7 +103,7 @@ class ConfigServer:
"""Health check endpoint."""
return {
"status": "ok",
"version": "1.4.0",
"version": "1.5.0",
"devices": self.device_count,
"subscriptions": self.subscription_count,
"last_config_update": (

View File

@ -1,6 +1,6 @@
[project]
name = "iot-bridge"
version = "1.4.0"
version = "1.5.0"
description = "IoT MQTT Bridge for Odoo - Autonomous MQTT-to-Odoo Integration Service"
requires-python = ">=3.10"
readme = "README.md"