Skip to content

Commit

Permalink
final fixes to calculated values.
Browse files Browse the repository at this point in the history
  • Loading branch information
mplogas committed Sep 20, 2024
1 parent bb74944 commit e6cc58b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/Ecowitt.Controller/Consumer/DataConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public Task OnHandle(GatewayApiData message)
{
updatedGateway.DiscoveryUpdate = true;


foreach (var sensor in updatedGateway.Sensors)
{
sensor.DiscoveryUpdate = true;
Expand Down
4 changes: 2 additions & 2 deletions src/Ecowitt.Controller/Mapping/SensorBuilderAddon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public static void CalculateGatewayAddons(ref Model.Gateway gateway, bool isMetr
var dewPoint = BuildTemperatureSensor("dewpointin", "Indoor Dewpoint",
isMetric
? CalculateDewPointMetric((double)tempin.Value, (double)humidityin.Value).ToString()
: CalculateDewPointImperial((double)tempin.Value, (double)humidityin.Value).ToString(), isMetric);
: CalculateDewPointImperial((double)tempin.Value, (double)humidityin.Value).ToString(), isMetric, isMetricdot);
if (dewPoint != null) gateway.Sensors.Add(dewPoint);
}

var temp = gateway.Sensors.FirstOrDefault(s => s.Name.Equals("tempf", StringComparison.InvariantCultureIgnoreCase));
var humidity = gateway.Sensors.FirstOrDefault(s => s.Name.Equals("humidity", StringComparison.InvariantCultureIgnoreCase));
if (temp != null && humidity != null)
{
var dewPoint = BuildTemperatureSensor("dewpointin", "Outdoor Dewpoint",
var dewPoint = BuildTemperatureSensor("dewpoint", "Outdoor Dewpoint",
isMetric
? CalculateDewPointMetric((double)temp.Value, (double)humidity.Value).ToString()
: CalculateDewPointImperial((double)temp.Value, (double)humidity.Value).ToString(), isMetric, isMetric);
Expand Down

0 comments on commit e6cc58b

Please sign in to comment.