Fix culture-sensitive parsing, log swallowing and closure capture

- DateTimeTypeConverter parses with the invariant culture instead of the
  ambient one (NordPool timestamps arrive as ISO-8601)
- Shower last-shower-time state is formatted with the invariant culture
- PresenceServiceTests no longer captures the loop variable in a Moq setup
- CheapestIntervalsFinderTests compare prices with a tolerance instead of
  floating-point equality
- MqttRecreateApp logs the unit_of_measurement read failure instead of
  silently swallowing every exception
- LightMonitorOptions moves to LightMonitor.Models so the namespace matches
  the project and file location
This commit is contained in:
2026-11-29 21:31:45 +02:00
parent b5e114be14
commit ada3c77778
15 changed files with 25 additions and 24 deletions
+2 -1
View File
@@ -208,8 +208,9 @@ public sealed class MqttRecreateApp
};
}
}
catch
catch (Exception ex)
{
_logger.LogDebug(ex, "Could not read unit_of_measurement for {EntityId}", NordPoolPriceEntityId);
}
return null;
+1 -1
View File
@@ -4,6 +4,7 @@ using HomeAssistant.Entities;
using HomeAssistant.Entities.Interfaces;
using HomeAssistantGenerated;
using HomeAssistantServer;
using LightMonitor.Models;
using Mappings;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@@ -21,7 +22,6 @@ using PowerMonitorManager.Models;
using ShowerMonitorManager;
using ShowerMonitorManager.Models;
using LightMonitorManager;
using LightMonitorManager.Models;
using BatteryMonitorManager;
using BatteryMonitorManager.Models;
using LeakMonitorManager;