Skip to content

Commit

Permalink
json with time
Browse files Browse the repository at this point in the history
  • Loading branch information
BenAhrdt committed Mar 4, 2024
1 parent 9e5c1ef commit 46cb065
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/modules/messagehandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class messagehandlerClass {
const deviceinformations = await this.adapter.getStateAsync(this.idDeviceinformations);
if(deviceinformations && deviceinformations.val !== ""){
this.deviceinformations = JSON.parse(deviceinformations.val);
this.adapter.log.warn("1");
}
else{
// Generate Infos of all defices and decoded folders
Expand All @@ -84,7 +83,6 @@ class messagehandlerClass {
await this.assignDeviceInformation(adapterObject._id,JSON.parse(uplinkState.val));
}
}
this.adapter.log.warn("2");
}
}
catch(error){
Expand Down Expand Up @@ -114,11 +112,13 @@ class messagehandlerClass {
case this.adapter.origin.ttn:
if(message.uplink_message && message.uplink_message.decoded_payload){
this.deviceinformations[changeInfo.deviceEUI].uplink.decoded = message.uplink_message.decoded_payload;
this.deviceinformations[changeInfo.deviceEUI].uplink.time = message.rx_metadata.time;
}
break;
case this.adapter.origin.chirpstack:
if(message.object){
this.deviceinformations[changeInfo.deviceEUI].uplink.decoded = message.object;
this.deviceinformations[changeInfo.deviceEUI].uplink.time = message.rxInfo[0].nsTime;
}
break;
}
Expand Down

0 comments on commit 46cb065

Please sign in to comment.