Merge pull request #517 from meshtastic/tele

fix #516: check Telemetry oneOf to update Nodeinfo
This commit is contained in:
Andre K 2022-11-06 08:45:01 -03:00 committed by GitHub
commit 8a03603ef8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -764,13 +764,11 @@ class MeshService : Service(), Logging {
defaultTime: Long = System.currentTimeMillis() defaultTime: Long = System.currentTimeMillis()
) { ) {
updateNodeInfo(fromNum) { updateNodeInfo(fromNum) {
it.deviceMetrics = DeviceMetrics( if (t.hasDeviceMetrics()) it.deviceMetrics = DeviceMetrics(
t.deviceMetrics, t.deviceMetrics, if (t.time != 0) t.time else (defaultTime / 1000L).toInt()
if (t.time != 0) t.time else (defaultTime / 1000L).toInt()
) )
it.environmentMetrics = EnvironmentMetrics( if (t.hasEnvironmentMetrics()) it.environmentMetrics = EnvironmentMetrics(
t.environmentMetrics, t.environmentMetrics, if (t.time != 0) t.time else (defaultTime / 1000L).toInt()
if (t.time != 0) t.time else (defaultTime / 1000L).toInt()
) )
} }
} }