Init
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace NordPool.Models;
|
||||
|
||||
public class CheapestIntervalResult
|
||||
{
|
||||
[JsonPropertyName("start")]
|
||||
public DateTime Start { get; set; }
|
||||
|
||||
[JsonPropertyName("end")]
|
||||
public DateTime End { get; set; }
|
||||
|
||||
[JsonPropertyName("price")]
|
||||
public double Price { get; set; }
|
||||
|
||||
[JsonPropertyName("rank")]
|
||||
public int Rank { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace NordPool.Models.Dtos;
|
||||
|
||||
public class NordPoolDayPriceDto
|
||||
{
|
||||
[JsonPropertyName("start")]
|
||||
public string? Start { get; set; }
|
||||
[JsonPropertyName("end")]
|
||||
public string? End { get; set; }
|
||||
[JsonPropertyName("price")]
|
||||
public double? Price { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace NordPool.Models.Dtos;
|
||||
|
||||
public class NordPoolPriceResultDto
|
||||
{
|
||||
[JsonPropertyName("LT")]
|
||||
public List<NordPoolDayPriceDto>? Prices { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NetDaemon.Extensions.Mqtt" Version="26.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\HomeAssistant.Models\HomeAssistant.Models.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace NordPool.Models;
|
||||
|
||||
public static class NordPoolConsts
|
||||
{
|
||||
public static readonly string ConfigEntry = "01K9HYQE4Y0E7KC36JZV11MEXH";
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace NordPool.Models;
|
||||
|
||||
public class NordPoolDayPrice
|
||||
{
|
||||
[JsonPropertyName("start")]
|
||||
public DateTime? Start { get; set; }
|
||||
|
||||
[JsonPropertyName("end")]
|
||||
public DateTime? End { get; set; }
|
||||
|
||||
[JsonPropertyName("price")]
|
||||
public double? Price { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using HomeAssistant.Models;
|
||||
using NetDaemon.Extensions.MqttEntityManager;
|
||||
|
||||
namespace NordPool.Models;
|
||||
|
||||
public class NordPoolEntity : EntityCreateModel
|
||||
{
|
||||
public string Domain { get; set; } // example: sensor
|
||||
public string Identifier { get; set; } // example: name of the sensor
|
||||
public string Name { get; set; } // friendly name for UI
|
||||
|
||||
public NordPoolEntity(string domain, string identifier, string name)
|
||||
{
|
||||
Domain = domain;
|
||||
Identifier = identifier;
|
||||
EntityId = $"{Domain}.{Identifier}";
|
||||
Name = string.IsNullOrWhiteSpace(name) ? identifier : name;
|
||||
|
||||
Options = new EntityCreationOptions
|
||||
{
|
||||
UniqueId = EntityId,
|
||||
Name = Name
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace NordPool.Models;
|
||||
|
||||
public class NordPoolPrice
|
||||
{
|
||||
public IList<NordPoolDayPrice>? Prices { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user