Skip to content

Conversation

@zhongys-c8y
Copy link
Contributor

datetime.now() was previously called only once, which resulted in all telemetry data having the same timestamp.

This is now changed to get the current time every time serialise() is called, to make sure the time is dynamically obtained.

@github-actions
Copy link

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
24 0 0 24 100 49.384594s

Passed Tests

Name ⏱️ Duration Suite
Device should support the operation c8y_ModbusConfiguration 0.168 s Device
Set values via c8y_ModbusConfiguration Operation 2.511 s Operation
Poll rate and transmit rate should be updated for the Device 0.253 s Operation
Poll rate and transmit rate should be updated on the Device 2.483 s Operation
Device should support the operation c8y_ModbusDevice 0.140 s Device
Device should support the operation c8y_SerialConfiguration 0.140 s Device
Set values via c8y_SerialConfiguration Operation 2.479 s Operation
Serial configuration should be updated for the Device 0.255 s Operation
Serial configuration should be updated on the Device 2.477 s Operation
Device should have installed software tedge-modbus-plugin 0.152 s Debian
Service should be active 2.494 s Debian
ReInstall Modbus Plugin 23.815 s Debian
Device should have the fragment c8y_ModbusConfiguration 0.279 s Device
ChildDevice TestCase1 should be created 0.271 s Device
ChildDevice TestCase1 should have the fragment c8y_ModbusDevice 0.673 s Device
Service tedge-modbus-plugin should be enabled 0.139 s Device
Device should set supported operations for writing to registers and coils 0.134 s Operations
Device should write to a register using explicit address format 2.500 s Operations
Device should write to a register referenced by name 2.490 s Operations
Device should write float value to register referenced by name 2.481 s Operations
Device should write to a coil 2.496 s Operations
ChildDevice TestCase1 should have a Test.Int16 Measurement 0.275 s Telemetry
ChildDevice TestCase1 should have a Test.Float32 Measurement 0.277 s Telemetry
ChildDevice TestCase1 should have Alarms of type TestAlarm on Coil Value 1 0.001 s Telemetry

Copy link
Contributor

@reubenmiller reubenmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Thanks for the fix!

@reubenmiller reubenmiller added this pull request to the merge queue Nov 13, 2025
Merged via the queue into thin-edge:main with commit 0eeaaf2 Nov 13, 2025
5 checks passed
@zhongys-c8y zhongys-c8y deleted the change-time branch November 13, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants