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
2 changes: 1 addition & 1 deletion dev/DebugHost/apps/ConcurrencyTestApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using NetDaemon.AppModel;
using NetDaemon.HassModel.Common;
using NetDaemon.HassModel;

namespace Apps;

Expand Down
2 changes: 1 addition & 1 deletion dev/DebugHost/apps/HelloApp/HelloApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Reactive.Linq;
using Microsoft.Extensions.Logging;
using NetDaemon.AppModel;
using NetDaemon.HassModel.Common;
using NetDaemon.HassModel;

namespace Apps;

Expand Down
2 changes: 1 addition & 1 deletion dev/DebugHost/apps/YamlApp/YamlApp.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

using NetDaemon.AppModel;
using NetDaemon.HassModel.Common;
using NetDaemon.HassModel;

namespace Apps;

Expand Down
10 changes: 5 additions & 5 deletions src/Client/NetDaemon.HassClient.Debug/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Hosting;
global using Microsoft.Extensions.Options;
global using NetDaemon.Client.Common;
global using NetDaemon.Client.Common.Extensions;
global using NetDaemon.Client.Common.HomeAssistant.Extensions;
global using NetDaemon.Client.Common.HomeAssistant.Model;
global using NetDaemon.Client.Common.Settings;
global using NetDaemon.Client;
global using NetDaemon.Client.Extensions;
global using NetDaemon.Client.HomeAssistant.Extensions;
global using NetDaemon.Client.HomeAssistant.Model;
global using NetDaemon.Client.Settings;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using NetDaemon.Client.Common.Extensions;
using NetDaemon.Client.Extensions;

namespace NetDaemon.HassClient.Tests.ExtensionsTest;

Expand Down
10 changes: 5 additions & 5 deletions src/Client/NetDaemon.HassClient.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
global using FluentAssertions;
global using Moq;
global using Xunit;
global using NetDaemon.Client.Common;
global using NetDaemon.Client.Common.HomeAssistant.Model;
global using NetDaemon.Client;
global using NetDaemon.Client.HomeAssistant.Model;
global using NetDaemon.Client.Internal;
global using NetDaemon.Client.Internal.Helpers;
global using NetDaemon.Client.Internal.Net;
global using NetDaemon.Client.Common.Exceptions;
global using NetDaemon.Client.Exceptions;
global using NetDaemon.Client.Internal.Extensions;
global using NetDaemon.Client.Internal.HomeAssistant.Commands;
global using NetDaemon.Client.Common.Settings;
global using NetDaemon.Client.Common.HomeAssistant.Extensions;
global using NetDaemon.Client.Settings;
global using NetDaemon.Client.HomeAssistant.Extensions;
global using NetDaemon.HassClient.Tests.Helpers;
2 changes: 1 addition & 1 deletion src/Client/NetDaemon.HassClient/Common/DisconnectReason.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common;
namespace NetDaemon.Client;

/// <summary>
/// The reason websocket connection disconnected
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.Exceptions;
namespace NetDaemon.Client.Exceptions;

// We allow exception not to have default constructors since
// in this case it only makes sense to have a reason
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.Extensions;
namespace NetDaemon.Client.Extensions;

/// <summary>
/// ServiceCollectionExtensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Extensions;
namespace NetDaemon.Client.HomeAssistant.Extensions;

/// <summary>
/// Extensions to HassEvents to convert to more specific event types
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Web;

namespace NetDaemon.Client.Common.HomeAssistant.Extensions;
namespace NetDaemon.Client.HomeAssistant.Extensions;

/// <summary>
/// Adds extensions to the IHomeAssistantApiManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Extensions;
namespace NetDaemon.Client.HomeAssistant.Extensions;

/// <summary>
/// HomeAssistantConnection extensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record CommandMessage : HassMessageBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassArea
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassConfig
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassContext
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassDevice
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassEntity
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassError
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassEvent
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassMessageBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassServiceEventData
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassState
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassStateChangedEventData
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

public record HassUnitSystem
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.HomeAssistant.Model;
namespace NetDaemon.Client.HomeAssistant.Model;

/// <summary>
/// Represents a target for a service call in Home Assistant
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common;
namespace NetDaemon.Client;

/// <summary>
/// Make connection to Home Assistant
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common;
namespace NetDaemon.Client;

/// <summary>
/// Handle home assistant API calls using json over http
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common;
namespace NetDaemon.Client;

/// <summary>
/// HomeAssistantClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common;
namespace NetDaemon.Client;

public interface IHomeAssistantConnection : IHomeAssistantApiManager, IAsyncDisposable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common;
namespace NetDaemon.Client;

public interface IHomeAssistantRunner : IAsyncDisposable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetDaemon.Client.Common.Settings;
namespace NetDaemon.Client.Settings;

/// <summary>
/// Home Assistant related settings
Expand Down
7 changes: 3 additions & 4 deletions src/Client/NetDaemon.HassClient/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Options;
// HassClient usings
global using NetDaemon.Client.Common;
global using NetDaemon.Client.Common.HomeAssistant.Model;
global using NetDaemon.Client.HomeAssistant.Model;
global using NetDaemon.Client.Internal;
global using NetDaemon.Client.Internal.Helpers;
global using NetDaemon.Client.Internal.Json;
global using NetDaemon.Client.Internal.Net;
global using NetDaemon.Client.Common.Exceptions;
global using NetDaemon.Client.Exceptions;
global using NetDaemon.Client.Internal.Extensions;
global using NetDaemon.Client.Internal.HomeAssistant.Commands;
global using NetDaemon.Client.Internal.HomeAssistant.Messages;
global using NetDaemon.Client.Common.Settings;
global using NetDaemon.Client.Settings;

// Make the internal visible to test project
[assembly: InternalsVisibleTo("NetDaemon.HassClient.Tests")]
Expand Down
1 change: 0 additions & 1 deletion src/Client/NetDaemon.HassClient/NetDaemon.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
</PackageDescription>
<PackageReleaseNotes>First alpha version, expect things to change!</PackageReleaseNotes>
<tags>Home Assistant</tags>
<RootNamespace>JoySoftware.NetDaemon.Client</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
using System;

namespace NetDaemon.Extensions.Scheduler
namespace NetDaemon.Extensions.Scheduler;

/// <summary>
/// Scheduler interface
/// </summary>
public interface INetDaemonScheduler
{
/// <summary>
/// Scheduler interface
/// Schedules an action every (timespan)
/// </summary>
public interface INetDaemonScheduler
{
/// <summary>
/// Schedules an action every (timespan)
/// </summary>
/// <param name="period">The period to schedule</param>
/// <param name="action">Action to run</param>
IDisposable RunEvery(TimeSpan period, Action action);
/// <param name="period">The period to schedule</param>
/// <param name="action">Action to run</param>
IDisposable RunEvery(TimeSpan period, Action action);

/// <summary>
/// Schedules an action every (timespan)
/// </summary>
/// <param name="period">The period to schedule</param>
/// <param name="startTime">The time to start the schedule</param>
/// <param name="action">Action to run</param>
IDisposable RunEvery(TimeSpan period, DateTimeOffset startTime, Action action);
/// <summary>
/// Schedules an action every (timespan)
/// </summary>
/// <param name="period">The period to schedule</param>
/// <param name="startTime">The time to start the schedule</param>
/// <param name="action">Action to run</param>
IDisposable RunEvery(TimeSpan period, DateTimeOffset startTime, Action action);

/// <summary>
/// Delays execution of an action (timespan) time
/// </summary>
/// <param name="timespan">Timespan to delay</param>
/// <param name="action">Action to run</param>
IDisposable RunIn(TimeSpan timespan, Action action);
/// <summary>
/// Delays execution of an action (timespan) time
/// </summary>
/// <param name="timespan">Timespan to delay</param>
/// <param name="action">Action to run</param>
IDisposable RunIn(TimeSpan timespan, Action action);

/// <summary>
/// Runs an action at a specific time
/// </summary>
/// <param name="timeOffset">Absolute time to run the action</param>
/// <param name="action">Action to run</param>
IDisposable RunAt(DateTimeOffset timeOffset, Action action);
/// <summary>
/// Runs an action at a specific time
/// </summary>
/// <param name="timeOffset">Absolute time to run the action</param>
/// <param name="action">Action to run</param>
IDisposable RunAt(DateTimeOffset timeOffset, Action action);

/// <summary>
/// The current time of the scheduler
/// </summary>
DateTimeOffset Now { get; }
}
/// <summary>
/// The current time of the scheduler
/// </summary>
DateTimeOffset Now { get; }
}
6 changes: 3 additions & 3 deletions src/Extensions/NetDaemon.Extensions.Tts/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
global using System.Threading.Channels;
global using System.Threading.Tasks;
global using Microsoft.Extensions.Logging;
global using NetDaemon.Client.Common;
global using NetDaemon.Client.Common.HomeAssistant.Extensions;
global using NetDaemon.Client.Common.HomeAssistant.Model;
global using NetDaemon.Client;
global using NetDaemon.Client.HomeAssistant.Extensions;
global using NetDaemon.Client.HomeAssistant.Model;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using NetDaemon.Client.Common.HomeAssistant.Model;
using NetDaemon.Client.HomeAssistant.Model;

namespace NetDaemon.HassModel.CodeGenerator;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using NetDaemon.Client.Common.HomeAssistant.Model;
using NetDaemon.Client.HomeAssistant.Model;

namespace NetDaemon.HassModel.CodeGenerator;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using NetDaemon.Client.Common.HomeAssistant.Model;
using NetDaemon.Client.HomeAssistant.Model;

namespace NetDaemon.HassModel.CodeGenerator;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Runtime.CompilerServices;
using NetDaemon.Client.Common.HomeAssistant.Model;
using NetDaemon.Client.HomeAssistant.Model;
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;

[assembly: InternalsVisibleTo("NetDaemon.Daemon.Tests")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
global using NetDaemon.HassModel.CodeGenerator.Model;
global using NetDaemon.HassModel.CodeGenerator.Helpers;
global using NetDaemon.HassModel.CodeGenerator.Extensions;
global using NetDaemon.HassModel.Common;
global using NetDaemon.HassModel.Entities;
global using Microsoft.CodeAnalysis;
global using static NetDaemon.HassModel.CodeGenerator.Helpers.NamingHelper;
Expand Down
10 changes: 5 additions & 5 deletions src/HassModel/NetDaemon.HassModel.CodeGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using NetDaemon.Client.Common;
using NetDaemon.Client.Common.Extensions;
using NetDaemon.Client.Common.HomeAssistant.Extensions;
using NetDaemon.Client.Common.HomeAssistant.Model;
using NetDaemon.Client.Common.Settings;
using NetDaemon.Client;
using NetDaemon.Client.Extensions;
using NetDaemon.Client.HomeAssistant.Extensions;
using NetDaemon.Client.HomeAssistant.Model;
using NetDaemon.Client.Settings;

#pragma warning disable CA1303
#pragma warning disable CA2007
Expand Down
Loading