Skip to content

Commit

Permalink
add timestamp to battery reading
Browse files Browse the repository at this point in the history
  • Loading branch information
b1conrad committed Jul 11, 2017
1 parent fba30ae commit 1c9c18f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions krl/wovyn_router.krl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ruleset wovyn_router {
meta {
shares __testing, lastHeartbeat, lastHumidity, lastTemperature, lastPressure, reading, battery
shares __testing, lastHeartbeat, lastHumidity, lastTemperature, lastPressure,
reading, battery
}
global {
__testing = { "queries": [ { "name": "__testing" } ],
Expand Down Expand Up @@ -48,7 +49,8 @@ ruleset wovyn_router {
pct = ent:lastHeartbeat.genericThing.healthPercent;
vlt = ent:lastHeartbeat.specificThing.battery.currentVoltage;
device = ent:lastHeartbeat.property.name;
{"text":"battery: " + pct + "% " + vlt + "v","username":device}
ans = "battery: " + pct + "% " + vlt + "v";
{"text":ans + " (as of " + ent:lastTimestamp + ")","username":device}
}
}

Expand Down

1 comment on commit 1c9c18f

@b1conrad
Copy link
Member Author

Choose a reason for hiding this comment

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

because if the battery level is too low, the reported value may be out-of-date

Please sign in to comment.