Skip to content

Commit

Permalink
Fix real time not running correctly
Browse files Browse the repository at this point in the history
Fix caught exception in Ecowitt API when there is no data returned
  • Loading branch information
mcrossley committed Jan 31, 2022
1 parent f433813 commit f2888f3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CumulusMX/Cumulus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
14 changes: 12 additions & 2 deletions CumulusMX/EcowittApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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; }
Expand Down
6 changes: 3 additions & 3 deletions CumulusMX/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -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")]
2 changes: 1 addition & 1 deletion Updates.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit f2888f3

Please sign in to comment.