Skip to content

Commit 66c4464

Browse files
committed
OPCUA converter timestamp = int(time() * 1000)
1 parent a788bb7 commit 66c4464

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

thingsboard_gateway/connectors/opcua/opcua_uplink_converter.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def convert(self, configs, values):
6767
telemetry_datapoints_count = 0
6868
attributes_datapoints_count = 0
6969

70-
basic_timestamp = int(time() * 1000)
70+
timestamp = int(time() * 1000)
7171

7272
for val, config in zip(values, configs):
7373
if not val:
@@ -91,16 +91,6 @@ def convert(self, configs, values):
9191

9292
section = DATA_TYPES[config['section']]
9393

94-
if val.SourceTimestamp is not None:
95-
if abs(basic_timestamp - val.SourceTimestamp.timestamp()) > 3600:
96-
self._log.warning("Timestamps are not in sync for incoming value: %r. "
97-
"Value timestamp: %s, current timestamp: %s",
98-
val, val.SourceTimestamp.timestamp(), basic_timestamp)
99-
else:
100-
basic_timestamp = val.SourceTimestamp.timestamp() * 1000
101-
102-
timestamp = basic_timestamp
103-
10494
if val.SourceTimestamp and section == TELEMETRY_PARAMETER:
10595
telemetry_datapoints_count += 1
10696
if timestamp in telemetry_datapoints:

0 commit comments

Comments
 (0)