diff --git a/flow_events.log b/flow_events.log deleted file mode 100644 index 7259e41..0000000 --- a/flow_events.log +++ /dev/null @@ -1,88 +0,0 @@ -{"track_id": "eb8f9278-db6e-4468-9eab-8cc47ceaf117", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T00:09:05.969925", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "eb8f9278-db6e-4468-9eab-8cc47ceaf117", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T00:09:05.969943", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "eb8f9278-db6e-4468-9eab-8cc47ceaf117", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T00:09:05.969826", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "2d10f1c0-ed7f-423e-94de-4f3d2f18a6bd", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T00:09:05.970079", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "2d10f1c0-ed7f-423e-94de-4f3d2f18a6bd", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T00:09:05.970115", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "2d10f1c0-ed7f-423e-94de-4f3d2f18a6bd", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T00:09:05.970131", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "f973e9fd-e476-47d7-8edf-d7449c1e477a", "event_type": "CommandFeedbackMsg", "source": "CommandService", "status": "created", "timestamp": "2026-01-11T00:09:12.704529", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T00:09:12.704399"}} -{"track_id": "f973e9fd-e476-47d7-8edf-d7449c1e477a", "event_type": "CommandFeedbackMsg", "source": "CommandController", "status": "forwarded", "timestamp": "2026-01-11T00:09:12.704642", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T00:09:12.704399"}} -{"track_id": "f973e9fd-e476-47d7-8edf-d7449c1e477a", "event_type": "CommandFeedbackMsg", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T00:09:12.704659", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T00:09:12.704399"}} -{"track_id": "7c5f469b-9adc-4a1b-9696-7140a5d203dd", "event_type": "SendCommandMsg", "source": "ConnectorManager", "status": "forwarded", "timestamp": "2026-01-11T00:09:12.704676", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "7c5f469b-9adc-4a1b-9696-7140a5d203dd", "event_type": "SendCommandMsg", "source": "CommunicationService", "status": "received", "timestamp": "2026-01-11T00:09:12.704688", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "7c5f469b-9adc-4a1b-9696-7140a5d203dd", "event_type": "SendCommandMsg", "source": "CommandService", "status": "received", "timestamp": "2026-01-11T00:09:12.704698", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "50f40287-bbf4-434c-8bd7-643724cf8df7", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T00:09:17.488924", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "50f40287-bbf4-434c-8bd7-643724cf8df7", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T00:09:17.488939", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "50f40287-bbf4-434c-8bd7-643724cf8df7", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T00:09:17.488835", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "f6794d48-62ff-4a87-b214-6ca04f57823e", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T00:09:17.489121", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "f6794d48-62ff-4a87-b214-6ca04f57823e", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T00:09:17.489157", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "f6794d48-62ff-4a87-b214-6ca04f57823e", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T00:09:17.489168", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "12c104c1-3b13-4560-bad8-e0bc9ea3a76b", "event_type": "TagUpdateMsg", "source": "DatapointService", "status": "created", "timestamp": "2026-01-11T00:09:24.095230", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T00:09:24.095176"}} -{"track_id": "12c104c1-3b13-4560-bad8-e0bc9ea3a76b", "event_type": "TagUpdateMsg", "source": "CommunicationService", "status": "received", "timestamp": "2026-01-11T00:09:24.095305", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T00:09:24.095176"}} -{"track_id": "12c104c1-3b13-4560-bad8-e0bc9ea3a76b", "event_type": "TagUpdateMsg", "source": "DatapointController", "status": "forwarded", "timestamp": "2026-01-11T00:09:24.095356", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T00:09:24.095176"}} -{"track_id": "12c104c1-3b13-4560-bad8-e0bc9ea3a76b", "event_type": "RawTagUpdateMsg", "source": "DatapointService", "status": "received", "timestamp": "2026-01-11T00:09:24.095370", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T00:09:24.095176"}} -{"track_id": "4080dbe7-8207-4d6c-98dd-9a98612cc6cf", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T00:10:43.864726", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "4080dbe7-8207-4d6c-98dd-9a98612cc6cf", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T00:10:43.864741", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "8ac84b34-5b41-457e-9365-9f79f88fd19e", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T00:10:43.864818", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "8ac84b34-5b41-457e-9365-9f79f88fd19e", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T00:10:43.864842", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "8ac84b34-5b41-457e-9365-9f79f88fd19e", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T00:10:43.864852", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "4080dbe7-8207-4d6c-98dd-9a98612cc6cf", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T00:10:43.864640", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "bfcb6942-c293-4684-a50b-03d02cfe44bc", "event_type": "CommandFeedbackMsg", "source": "CommandService", "status": "created", "timestamp": "2026-01-11T00:10:51.078643", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T00:10:51.078581"}} -{"track_id": "bfcb6942-c293-4684-a50b-03d02cfe44bc", "event_type": "CommandFeedbackMsg", "source": "CommandController", "status": "forwarded", "timestamp": "2026-01-11T00:10:51.078721", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T00:10:51.078581"}} -{"track_id": "bfcb6942-c293-4684-a50b-03d02cfe44bc", "event_type": "CommandFeedbackMsg", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T00:10:51.078735", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T00:10:51.078581"}} -{"track_id": "54d883f7-bf09-47d7-b5e5-ca795f927c63", "event_type": "SendCommandMsg", "source": "ConnectorManager", "status": "forwarded", "timestamp": "2026-01-11T00:10:51.078748", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "54d883f7-bf09-47d7-b5e5-ca795f927c63", "event_type": "SendCommandMsg", "source": "CommunicationService", "status": "received", "timestamp": "2026-01-11T00:10:51.078756", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "54d883f7-bf09-47d7-b5e5-ca795f927c63", "event_type": "SendCommandMsg", "source": "CommandService", "status": "received", "timestamp": "2026-01-11T00:10:51.078764", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "2f808119-13a0-469d-a8b4-134bcd1c38ac", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T00:10:55.271354", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "2f808119-13a0-469d-a8b4-134bcd1c38ac", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T00:10:55.271370", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "2f808119-13a0-469d-a8b4-134bcd1c38ac", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T00:10:55.271269", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "9bce5503-73e9-46ac-81f3-5dd24ba5b604", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T00:10:55.271544", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "9bce5503-73e9-46ac-81f3-5dd24ba5b604", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T00:10:55.271596", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "9bce5503-73e9-46ac-81f3-5dd24ba5b604", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T00:10:55.271613", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "e9792789-7640-4ca1-97c9-9a857da6fe31", "event_type": "TagUpdateMsg", "source": "DatapointService", "status": "created", "timestamp": "2026-01-11T00:11:02.454424", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T00:11:02.454342"}} -{"track_id": "e9792789-7640-4ca1-97c9-9a857da6fe31", "event_type": "TagUpdateMsg", "source": "CommunicationService", "status": "received", "timestamp": "2026-01-11T00:11:02.454557", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T00:11:02.454342"}} -{"track_id": "e9792789-7640-4ca1-97c9-9a857da6fe31", "event_type": "TagUpdateMsg", "source": "DatapointController", "status": "forwarded", "timestamp": "2026-01-11T00:11:02.454657", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T00:11:02.454342"}} -{"track_id": "e9792789-7640-4ca1-97c9-9a857da6fe31", "event_type": "RawTagUpdateMsg", "source": "DatapointService", "status": "received", "timestamp": "2026-01-11T00:11:02.454683", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T00:11:02.454342"}} -{"track_id": "752ce2fc-00e9-44b0-97c8-df1806449ce6", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T09:57:01.282748", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "752ce2fc-00e9-44b0-97c8-df1806449ce6", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T09:57:01.282764", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "43efe369-4bbc-4fc1-b0b4-8104556d9d97", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T09:57:01.282801", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "43efe369-4bbc-4fc1-b0b4-8104556d9d97", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T09:57:01.282825", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "43efe369-4bbc-4fc1-b0b4-8104556d9d97", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T09:57:01.282835", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "752ce2fc-00e9-44b0-97c8-df1806449ce6", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T09:57:01.282663", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "da4167a2-1704-42a5-8719-24a50f11cf22", "event_type": "CommandFeedbackMsg", "source": "CommandService", "status": "created", "timestamp": "2026-01-11T09:57:08.328990", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T09:57:08.328914"}} -{"track_id": "da4167a2-1704-42a5-8719-24a50f11cf22", "event_type": "CommandFeedbackMsg", "source": "CommandController", "status": "forwarded", "timestamp": "2026-01-11T09:57:08.329108", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T09:57:08.328914"}} -{"track_id": "da4167a2-1704-42a5-8719-24a50f11cf22", "event_type": "CommandFeedbackMsg", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T09:57:08.329128", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T09:57:08.328914"}} -{"track_id": "b0d4d65f-7fb0-4989-a39e-fa88c85b7ef0", "event_type": "SendCommandMsg", "source": "ConnectorManager", "status": "forwarded", "timestamp": "2026-01-11T09:57:08.329151", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "b0d4d65f-7fb0-4989-a39e-fa88c85b7ef0", "event_type": "SendCommandMsg", "source": "CommunicationService", "status": "received", "timestamp": "2026-01-11T09:57:08.329160", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "b0d4d65f-7fb0-4989-a39e-fa88c85b7ef0", "event_type": "SendCommandMsg", "source": "CommandService", "status": "received", "timestamp": "2026-01-11T09:57:08.329170", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "8c1fb17e-f73f-4fb0-9e56-020d74e06520", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T09:57:13.313666", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "8c1fb17e-f73f-4fb0-9e56-020d74e06520", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T09:57:13.313684", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "476fecae-d191-465f-9b97-82f6760e6614", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T09:57:13.313724", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "476fecae-d191-465f-9b97-82f6760e6614", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T09:57:13.313751", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "476fecae-d191-465f-9b97-82f6760e6614", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T09:57:13.313762", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "8c1fb17e-f73f-4fb0-9e56-020d74e06520", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T09:57:13.313574", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "878ac7f3-c395-4dc4-9f8c-b0f93be6ebdb", "event_type": "TagUpdateMsg", "source": "DatapointService", "status": "created", "timestamp": "2026-01-11T09:57:19.734210", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T09:57:19.734077"}} -{"track_id": "878ac7f3-c395-4dc4-9f8c-b0f93be6ebdb", "event_type": "TagUpdateMsg", "source": "CommunicationService", "status": "received", "timestamp": "2026-01-11T09:57:19.734382", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T09:57:19.734077"}} -{"track_id": "878ac7f3-c395-4dc4-9f8c-b0f93be6ebdb", "event_type": "TagUpdateMsg", "source": "DatapointController", "status": "forwarded", "timestamp": "2026-01-11T09:57:19.734531", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T09:57:19.734077"}} -{"track_id": "878ac7f3-c395-4dc4-9f8c-b0f93be6ebdb", "event_type": "RawTagUpdateMsg", "source": "DatapointService", "status": "received", "timestamp": "2026-01-11T09:57:19.734570", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T09:57:19.734077"}} -{"track_id": "c56d6baf-dd79-4194-8da8-a3b1f8b23d26", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T09:58:23.637847", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "c56d6baf-dd79-4194-8da8-a3b1f8b23d26", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T09:58:23.637867", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "47798393-0290-4c3e-bd97-48d18006a05d", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T09:58:23.637911", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "47798393-0290-4c3e-bd97-48d18006a05d", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T09:58:23.637942", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "47798393-0290-4c3e-bd97-48d18006a05d", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T09:58:23.637955", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "c56d6baf-dd79-4194-8da8-a3b1f8b23d26", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T09:58:23.637747", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "1c33590d-5f36-44c5-a2d7-746906b3fdf5", "event_type": "CommandFeedbackMsg", "source": "CommandService", "status": "created", "timestamp": "2026-01-11T09:58:30.541156", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T09:58:30.541041"}} -{"track_id": "1c33590d-5f36-44c5-a2d7-746906b3fdf5", "event_type": "CommandFeedbackMsg", "source": "CommandController", "status": "forwarded", "timestamp": "2026-01-11T09:58:30.541285", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T09:58:30.541041"}} -{"track_id": "1c33590d-5f36-44c5-a2d7-746906b3fdf5", "event_type": "CommandFeedbackMsg", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T09:58:30.541306", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42, "feedback": "NOK-driver-offline", "timestamp": "2026-01-11T09:58:30.541041"}} -{"track_id": "e6bf72fd-823a-48dc-b633-56e59c55acc9", "event_type": "SendCommandMsg", "source": "ConnectorManager", "status": "forwarded", "timestamp": "2026-01-11T09:58:30.541326", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "e6bf72fd-823a-48dc-b633-56e59c55acc9", "event_type": "SendCommandMsg", "source": "CommunicationService", "status": "received", "timestamp": "2026-01-11T09:58:30.541340", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "e6bf72fd-823a-48dc-b633-56e59c55acc9", "event_type": "SendCommandMsg", "source": "CommandService", "status": "received", "timestamp": "2026-01-11T09:58:30.541351", "payload": {"command_id": "testcmd1", "datapoint_identifier": "WaterTank@TANK", "value": 42}} -{"track_id": "5442d7d9-1d11-455b-a888-55a9efee35cb", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T09:58:34.870156", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "5442d7d9-1d11-455b-a888-55a9efee35cb", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T09:58:34.870172", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "f1221057-54aa-4552-8036-2ee8c13118f9", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T09:58:34.870209", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "f1221057-54aa-4552-8036-2ee8c13118f9", "event_type": "DriverConnectStatus", "source": "CommunicationController", "status": "forwarded", "timestamp": "2026-01-11T09:58:34.870232", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "f1221057-54aa-4552-8036-2ee8c13118f9", "event_type": "DriverConnectStatus", "source": "ConnectorManager", "status": "received", "timestamp": "2026-01-11T09:58:34.870242", "payload": {"driver_name": "AuxServer", "status": "offline"}} -{"track_id": "5442d7d9-1d11-455b-a888-55a9efee35cb", "event_type": "DriverConnectStatus", "source": "CommunicationService", "status": "created", "timestamp": "2026-01-11T09:58:34.870065", "payload": {"driver_name": "WaterTank", "status": "offline"}} -{"track_id": "54726493-d968-4b6e-a4a7-a8b10c7a00d1", "event_type": "TagUpdateMsg", "source": "DatapointService", "status": "created", "timestamp": "2026-01-11T09:58:41.895556", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T09:58:41.895439"}} -{"track_id": "54726493-d968-4b6e-a4a7-a8b10c7a00d1", "event_type": "TagUpdateMsg", "source": "CommunicationService", "status": "received", "timestamp": "2026-01-11T09:58:41.895658", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T09:58:41.895439"}} -{"track_id": "54726493-d968-4b6e-a4a7-a8b10c7a00d1", "event_type": "TagUpdateMsg", "source": "DatapointController", "status": "forwarded", "timestamp": "2026-01-11T09:58:41.895726", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T09:58:41.895439"}} -{"track_id": "54726493-d968-4b6e-a4a7-a8b10c7a00d1", "event_type": "RawTagUpdateMsg", "source": "DatapointService", "status": "received", "timestamp": "2026-01-11T09:58:41.895742", "payload": {"datapoint_identifier": "WaterTank@TANK", "value": 123.45, "timestamp": "2026-01-11T09:58:41.895439"}} diff --git a/pytest.ini b/pytest.ini index d75c367..c2f826d 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,4 +4,7 @@ addopts = -v testpaths = tests python_files = test_*.py -pythonpath = openscada_lite \ No newline at end of file +pythonpath = openscada_lite +[coverage:run] +omit = + */__init__.py \ No newline at end of file diff --git a/src/openscada_lite/modules/animation/controller.py b/src/openscada_lite/modules/animation/controller.py index 8c10486..e49b06d 100644 --- a/src/openscada_lite/modules/animation/controller.py +++ b/src/openscada_lite/modules/animation/controller.py @@ -66,7 +66,7 @@ async def list_svgs(): }, ) async def svg(filename: str): - logger.debug(f"Requested SVG file: {filename}") + logger.debug(f"Requested SVG file: {filename}") logger.debug(f"SVG directory: {self.svg_folder}") file = Path(self.svg_folder) / filename if file.exists(): diff --git a/src/openscada_lite/modules/communication/drivers/mqtt_tasmota_driver.py b/src/openscada_lite/modules/communication/drivers/mqtt_tasmota_driver.py index 672ee54..9ae28b1 100644 --- a/src/openscada_lite/modules/communication/drivers/mqtt_tasmota_driver.py +++ b/src/openscada_lite/modules/communication/drivers/mqtt_tasmota_driver.py @@ -59,6 +59,8 @@ def __init__(self, server_name: str) -> None: # Track last known relay status per relay key (RELAY_1, RELAY_2) self._relay_status: dict[str, str] = {} + self._demo: bool = True # Default to demo mode + # -------------------------------------------------- # Lifecycle # -------------------------------------------------- @@ -73,7 +75,20 @@ def initialize(self, config: dict) -> None: self._subscriptions = config.get("subscriptions", []) self._publish_templates = config.get("publish", {}) + self._demo = config.get("demo", True) # Default to True + async def connect(self) -> None: + if self._demo: + self._connected = True + if self._status_listener and self._loop: + await self._status_listener( + DriverConnectStatus( + driver_name=self._server_name, + status="online", + ) + ) + return + self._loop = asyncio.get_running_loop() self._client = mqtt.Client(client_id=self._config.get("client_id")) @@ -97,6 +112,17 @@ async def connect(self) -> None: self._client.loop_start() async def disconnect(self) -> None: + if self._demo: + self._connected = False + if self._status_listener and self._loop: + await self._status_listener( + DriverConnectStatus( + driver_name=self._server_name, + status="offline", + ) + ) + return + if self._client: self._client.loop_stop() self._client.disconnect() @@ -110,6 +136,30 @@ def subscribe(self, datapoints: List[Datapoint]) -> None: pass async def send_command(self, data: SendCommandMsg) -> None: + if self._demo: + # Simulate immediate feedback and status update + if self._feedback_listener: + await self._feedback_listener( + CommandFeedbackMsg( + command_id=data.command_id, + datapoint_identifier=data.datapoint_identifier, + feedback="OK", + value=data.value, + timestamp=datetime.datetime.now(), + ) + ) + # Simulate status update + relay_key = data.datapoint_identifier.split("@", 1)[1].replace("_CMD", "") + if self._value_listener: + await self._value_listener( + RawTagUpdateMsg( + datapoint_identifier=f"{self._server_name}@{relay_key}_STATUS", + value=data.value, + timestamp=datetime.datetime.now(), + ) + ) + return + if not self._client or not self._loop: return diff --git a/src/openscada_lite/modules/communication/manager/connector_manager.py b/src/openscada_lite/modules/communication/manager/connector_manager.py index 6ac01b6..ce21089 100644 --- a/src/openscada_lite/modules/communication/manager/connector_manager.py +++ b/src/openscada_lite/modules/communication/manager/connector_manager.py @@ -84,7 +84,12 @@ def __init__(self): driver_cls = DRIVER_REGISTRY.get(cfg["driver_class"]) if not driver_cls: raise ValueError(f"Unknown driver class: {cfg['driver_class']}") - driver_instance: DriverProtocol = driver_cls(cfg['name']) + # Instantiate driver using config name as server identifier; no connection_info required + try: + driver_instance: DriverProtocol = driver_cls(cfg["name"]) # Preferred signature + except TypeError: + # Fallback for drivers that accept kwargs + driver_instance = driver_cls(server_name=cfg["name"]) # NOSONAR driver_instance.initialize(cfg.get("params", {})) driver_instance.subscribe(datapoint_objs) self.driver_instances[cfg["name"]] = driver_instance diff --git a/tests/test_animation_service.py b/tests/test_animation_service.py index d130394..5b3b08b 100644 --- a/tests/test_animation_service.py +++ b/tests/test_animation_service.py @@ -103,7 +103,7 @@ def dummy_config(monkeypatch, tmp_path): # Patch Config methods used by AnimationService monkeypatch.setattr(Config, "get_svg_files", lambda self: ["tank.svg"]) - monkeypatch.setattr(Config, "_get_svg_folder", lambda self: str(svg_dir)) + monkeypatch.setattr(Config, "get_svg_folder", lambda self: str(svg_dir)) monkeypatch.setattr(Config, "get_animations", lambda self: dummy_animations) monkeypatch.setattr( Config, diff --git a/tests/test_command_app.py b/tests/test_command_app.py index 93335f0..023426d 100644 --- a/tests/test_command_app.py +++ b/tests/test_command_app.py @@ -39,6 +39,7 @@ def allow_all_security(monkeypatch): def run_server(): import subprocess import time + import socket from pathlib import Path # Ensure SCADA_CONFIG_PATH is set @@ -57,7 +58,16 @@ def run_server(): ], env=os.environ.copy(), # Pass the current environment variables to the subprocess ) - time.sleep(2) # Give the server time to start + # Wait for server readiness (avoid race conditions) + start = time.time() + while True: + try: + with socket.create_connection(("127.0.0.1", 5000), timeout=0.5): + break + except OSError: + if time.time() - start > 10: + raise RuntimeError("Server on 127.0.0.1:5000 did not start within 10s") + time.sleep(0.2) yield process.terminate() process.wait() diff --git a/tests/test_datapoint_app.py b/tests/test_datapoint_app.py index 1e2274f..751a145 100644 --- a/tests/test_datapoint_app.py +++ b/tests/test_datapoint_app.py @@ -16,6 +16,7 @@ def run_server(): import subprocess import time + import socket import os # Ensure SCADA_CONFIG_PATH is set @@ -33,7 +34,16 @@ def run_server(): ], env=os.environ.copy(), # Pass the current environment variables to the subprocess ) - time.sleep(2) # Give the server time to start + # Wait for server readiness (avoid race conditions) + start = time.time() + while True: + try: + with socket.create_connection(("127.0.0.1", 5001), timeout=0.5): + break + except OSError: + if time.time() - start > 10: + raise RuntimeError("Server on 127.0.0.1:5001 did not start within 10s") + time.sleep(0.2) yield process.terminate() process.wait() diff --git a/tests/test_mqtt_tasmota_driver.py b/tests/test_mqtt_tasmota_driver.py index 218dc54..da593f3 100644 --- a/tests/test_mqtt_tasmota_driver.py +++ b/tests/test_mqtt_tasmota_driver.py @@ -71,6 +71,7 @@ async def test_mqtt_connect_emits_status_and_subscribes(monkeypatch): {"topic": "stat/{device}/RESULT", "type": "feedback"}, ], "publish": {"command": "cmnd/{device}/{power}"}, + "demo": False, } ) @@ -115,6 +116,7 @@ async def test_mqtt_toggle_publishes_opposite_and_feedback(monkeypatch): ], "publish": {"command": "cmnd/{device}/{power}"}, "command_timeout": 2, + "demo": False, } ) @@ -174,6 +176,7 @@ async def test_mqtt_toggle_unknown_state_sends_toggle(monkeypatch): "relay_mapping": {"RELAY_2": "POWER2"}, "subscriptions": [], "publish": {"command": "cmnd/{device}/{power}"}, + "demo": False, } )