From 73166b26701a38b3becd247c8c702ec92015bfe3 Mon Sep 17 00:00:00 2001 From: PicelBoi <101955849+PicelBoi@users.noreply.github.com> Date: Mon, 15 Dec 2025 22:02:14 -0500 Subject: [PATCH] Add TideForecast and WateringNeeds to TimedTasks --- MistWX-i2Me/Config.cs | 10 ++++++++++ MistWX-i2Me/TimedTasks.cs | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/MistWX-i2Me/Config.cs b/MistWX-i2Me/Config.cs index 22399f8..d5fb440 100644 --- a/MistWX-i2Me/Config.cs +++ b/MistWX-i2Me/Config.cs @@ -109,6 +109,14 @@ public class Config "MetroMapCity6", "MetroMapCity7", "MetroMapCity8", + "TideStation1", + "TideStation2", + "TideStation3", + "TideStation4", + "TideStation5", + "TideStation6", + "TideStation7", + "TideStation8", }; } @@ -141,5 +149,7 @@ public class Config [XmlElement] public bool Breathing { get; set; } = true; [XmlElement] public bool HeatingAndCooling { get; set; } = true; [XmlElement] public bool PollenForecast { get; set; } = true; + [XmlElement] public bool WateringNeeds { get; set; } = true; + [XmlElement] public bool TideForecast { get; set; } = true; } } diff --git a/MistWX-i2Me/TimedTasks.cs b/MistWX-i2Me/TimedTasks.cs index d95e271..09fd89a 100644 --- a/MistWX-i2Me/TimedTasks.cs +++ b/MistWX-i2Me/TimedTasks.cs @@ -175,6 +175,22 @@ public class TimedTasks sender.SendFile(brsRecord, "storeData(QGROUP=__Breathing__,Feed=Breathing)"); } + if (dataConfig.TideForecast) + { + Log.Info($"Building Tide Forecast I2 record for {locations.Length} locations.."); + List> tfcst = await new TideForecastProduct().Populate(locations); + string tfcstRecord = await new TideForecastRecord().MakeRecord(tfcst); + sender.SendFile(tfcstRecord, "storeData(QGROUP=__TidesForecast__,Feed=TidesForecast)"); + } + + if (dataConfig.WateringNeeds) + { + Log.Info($"Building Watering Needs I2 record for {locations.Length} locations.."); + List> wns = await new WateringNeedsProduct().Populate(locations); + string wnsRecord = await new WateringNeedsRecord().MakeRecord(wns); + sender.SendFile(wnsRecord, "storeData(QGROUP=__WateringNeeds__,Feed=WateringNeeds)"); + } + string nextTimestamp = DateTime.Now.AddSeconds(generationInterval).ToString("h:mm tt"); watch.Stop();