Integriert SessionDetector vollständig in iot_bridge_service: iot_bridge_service.py: - SessionDetector Import & _detectors Dictionary - Timeout Worker Thread für automatisches Session-Ende - _restore_detector_states() bei Service-Start - _get_or_create_detector() Factory Methode - _process_session() ruft detector.process_power_event(env, power, ts) - _timeout_worker_loop() prüft alle 10s auf Timeouts models/mqtt_session.py: - current_power_w Field für Live-Power Updates - current_state Field für State Machine Status (idle/starting/standby/working/stopping) - last_message_time Field für Timeout Detection tests/__init__.py: - Import test_session_detector Module Diese Änderungen sind essentiell für SessionDetector! Ohne sie würde der Detector nicht aufgerufen werden. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| mqtt_connection.py | ||
| mqtt_device.py | ||
| mqtt_message.py | ||
| mqtt_session.py | ||