a9f329ffcd
- Drop the HomeAssistant.McpServer wiring from opencode.json along with the Cursor live-validation hook, rule and skill; update AGENTS.md and README - Rename ShouldFetchNewPrices to ShouldFetchTodaysPrices and add a separate ShouldFetchTomorrowPrice that waits until the CET publish hour (TomorrowPricesPublishHour) - Inject TimeProvider into NordPoolPriceService, use the CET zone for the current date and record fetch timestamps from it - Rework the NordPool tests around FakeTimeProvider and cover fetching only today before the publish hour
25 lines
685 B
C#
25 lines
685 B
C#
#region
|
|
|
|
using System.Text.Json;
|
|
using NordPool.Models;
|
|
|
|
#endregion
|
|
|
|
namespace NordPoolManager.Interface;
|
|
|
|
public interface INordPoolPriceService
|
|
{
|
|
NordPoolPrice? TodayNordPoolPrice { get; }
|
|
NordPoolPrice? TomorrowNordPoolPrice { get; }
|
|
double CurrentPrice { get; }
|
|
int DayQuartersIndex { get; }
|
|
DateTime? LastUpdatedDate { get; }
|
|
DateOnly? LastFetchedDate { get; }
|
|
|
|
Task FetchPricesAsync(Func<DateOnly, Task<NordPoolPrice>> fetchPricesForDate);
|
|
NordPoolPrice ParseAndAdjust(JsonElement? element);
|
|
void UpdateCurrentPrice();
|
|
double GetCurrentPrice();
|
|
bool ShouldFetchTodaysPrices(DateOnly dateOnly);
|
|
void RollOverPrices(DateOnly date);
|
|
} |