Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using NetDaemon.Runtime.Internal.Model;
namespace NetDaemon.Client.HomeAssistant.Extensions;

namespace NetDaemon.Runtime.Internal;

internal static class HomeAssistantConnectionExtensions
public static class HomeAssistantConnectionHelpersExtensions
{
public static async Task<InputBooleanHelper?> CreateInputBooleanHelperAsync(
this IHomeAssistantConnection connection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Text.Json.Serialization;

namespace NetDaemon.Runtime.Internal.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

internal record InputBooleanHelper
public record InputBooleanHelper
{
[JsonPropertyName("name")] public string Name { get; init; } = string.Empty;
[JsonPropertyName("name")] public string Name { get; init; } = String.Empty;
[JsonPropertyName("icon")] public string? Icon { get; init; }
[JsonPropertyName("id")] public string Id { get; init; } = string.Empty;
[JsonPropertyName("id")] public string Id { get; init; } = String.Empty;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text.Json.Serialization;
using NetDaemon.Client.HomeAssistant.Model;

namespace NetDaemon.Runtime.Internal.Model;
namespace NetDaemon.Client.Internal.HomeAssistant.Commands;

internal record CreateInputBooleanHelperCommand : CommandMessage
{
Expand All @@ -10,7 +10,7 @@ public CreateInputBooleanHelperCommand()
Type = "input_boolean/create";
}

[JsonPropertyName("name")] public string Name { get; init; } = string.Empty;
[JsonPropertyName("name")] public required string Name { get; init; }
}

internal record DeleteInputBooleanHelperCommand : CommandMessage
Expand All @@ -20,7 +20,7 @@ public DeleteInputBooleanHelperCommand()
Type = "input_boolean/delete";
}

[JsonPropertyName("input_boolean_id")] public string InputBooleanId { get; init; } = string.Empty;
[JsonPropertyName("input_boolean_id")] public required string InputBooleanId { get; init; } = string.Empty;
}

internal record ListInputBooleanHelperCommand : CommandMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using NetDaemon.Client.Internal.Exceptions;
using NetDaemon.HassModel;
using NetDaemon.Runtime.Internal;
using NetDaemon.Runtime.Internal.Model;

namespace NetDaemon.Runtime.Tests.Internal;

Expand Down Expand Up @@ -109,7 +108,7 @@ public async Task TestGetStateAsyncNotExistReturnsCorrectStateEnabled()
n.SendCommandAndReturnResponseAsync<CreateInputBooleanHelperCommand, InputBooleanHelper>(
It.IsAny<CreateInputBooleanHelperCommand>(), It.IsAny<CancellationToken>()));
haConnectionMock.Verify(n =>
n.SendCommandAsync<CallServiceCommand>(It.IsAny<CallServiceCommand>(),
n.SendCommandAsync(It.IsAny<CallServiceCommand>(),
It.IsAny<CancellationToken>()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Microsoft.Extensions.Hosting;
using NetDaemon.Client.Internal.Exceptions;
using NetDaemon.Runtime.Internal;
using NetDaemon.Runtime.Internal.Model;

namespace NetDaemon.Runtime.Tests.Internal;

Expand Down