From f2888f342efe89f22a6406e0264df1ec1d1efb02 Mon Sep 17 00:00:00 2001 From: Mark Crossley <1196094+mcrossley@users.noreply.github.com> Date: Mon, 31 Jan 2022 13:44:46 +0000 Subject: [PATCH] Fix real time not running correctly Fix caught exception in Ecowitt API when there is no data returned --- CumulusMX/Cumulus.cs | 3 ++- CumulusMX/EcowittApi.cs | 14 ++++++++++++-- CumulusMX/Properties/AssemblyInfo.cs | 6 +++--- Updates.txt | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CumulusMX/Cumulus.cs b/CumulusMX/Cumulus.cs index 1130056c..aec7e7ff 100644 --- a/CumulusMX/Cumulus.cs +++ b/CumulusMX/Cumulus.cs @@ -2720,9 +2720,10 @@ internal void RealtimeTimerTick(object sender, ElapsedEventArgs elapsedEventArgs return; } - if ((!station.PressReadyToPlot || station.TempReadyToPlot || station.WindReadyToPlot) && !StationOptions.NoSensorCheck) + if ((!station.PressReadyToPlot || !station.TempReadyToPlot || !station.WindReadyToPlot) && !StationOptions.NoSensorCheck) { // not all the data is ready and NoSensorCheck is not enabled + LogMessage($"Realtime[{cycle}]: Not all data is ready, aborting process"); return; } diff --git a/CumulusMX/EcowittApi.cs b/CumulusMX/EcowittApi.cs index 1d20cb7f..4a28653e 100644 --- a/CumulusMX/EcowittApi.cs +++ b/CumulusMX/EcowittApi.cs @@ -199,8 +199,16 @@ internal bool GetHistoricData(DateTime startTime, DateTime endTime) { try { - data = histObj.data; - success = true; + if (histObj.data != null) + { + data = histObj.data; + success = true; + } + else + { + // There was no data returned. + return false; + } } catch (Exception ex) { @@ -1317,6 +1325,8 @@ internal class EcowittHistoricResp public EcowittHistoricData data { get; set; } } + //TODO: OK this works, but ouch! + // refactor data as a dictionary object and parse each item indivually internal class EcowittHistoricData { public EcowittHistoricTempHum indoor { get; set; } diff --git a/CumulusMX/Properties/AssemblyInfo.cs b/CumulusMX/Properties/AssemblyInfo.cs index 238f387d..cc35a2d3 100644 --- a/CumulusMX/Properties/AssemblyInfo.cs +++ b/CumulusMX/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Cumulus MX")] -[assembly: AssemblyDescription("Version 3.15.0 - Build 3167")] +[assembly: AssemblyDescription("Version 3.15.0 - Build 3169")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Cumulus MX")] @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.15.0.3167")] -[assembly: AssemblyFileVersion("3.15.0.3167")] +[assembly: AssemblyVersion("3.15.0.3169")] +[assembly: AssemblyFileVersion("3.15.0.3169")] diff --git a/Updates.txt b/Updates.txt index 6f56ae80..ba5b1cba 100644 --- a/Updates.txt +++ b/Updates.txt @@ -1,4 +1,4 @@ -3.15.0 - b3167 +3.15.0 - b3169 —————————————— - Fix: Prevent real time processing occurring before first data has been received - Fix: Davis WLL: Add missing decode of THSW from current data