Skip to content

Commit

Permalink
Suppress HTTP Ecowitt station uptime message if zero
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrossley committed Sep 6, 2022
1 parent 9e5fd7e commit bb6683c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CumulusMX/HttpStationEcowitt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,12 @@ public string ApplyData(string dataString, bool main, DateTime? ts = null)
if ((recDate.Minute % 20) == 0 || lastMinute == -1 && data["runtime"] != null)
{
var runtime = Convert.ToInt32(data["runtime"]);
var uptime = TimeSpan.FromSeconds(runtime);
if (runtime > 0)
{
var uptime = TimeSpan.FromSeconds(runtime);

cumulus.LogMessage($"Ecowitt Gateway uptime = {runtime} secs - {uptime:c}");
cumulus.LogMessage($"Ecowitt Gateway uptime = {runtime} secs - {uptime:c}");
}
}

lastMinute = recDate.Minute;
Expand Down

0 comments on commit bb6683c

Please sign in to comment.