Skip to content

Commit faeba99

Browse files
committed
Clean up after rebase
1 parent 437b5b8 commit faeba99

File tree

7 files changed

+5
-21
lines changed

7 files changed

+5
-21
lines changed

NetDaemon.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ EndProject
6868
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetDaemon.AppModel.SourceDeployedApps", "src\AppModel\NetDaemon.AppModel.SourceDeployedApps\NetDaemon.AppModel.SourceDeployedApps.csproj", "{AE48B790-C3D7-440E-945E-EE5C82AE2A86}"
6969
EndProject
7070
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DebugMinimalHost", "src\debug\DebugMinimalHost\DebugMinimalHost.csproj", "{24BF4C65-4F48-4349-9649-E152A4E1496E}"
71+
EndProject
7172
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleClient", "src\debug\ConsoleClient\ConsoleClient.csproj", "{E966FBC9-D7AF-44F1-BE0F-C344B01A5323}"
7273
EndProject
7374
Global

src/Client/NetDaemon.HassClient/Common/Extensions/ServiceCollectionExtension.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@ public static IServiceCollection AddHomeAssistantClient(this IServiceCollection
1717
.AddSingleton<IHomeAssistantRunner>(s => s.GetRequiredService<HomeAssistantRunner>())
1818
.AddSingleton<HomeAssistantApiManager>()
1919
.AddSingleton<IHomeAssistantApiManager>(s => s.GetRequiredService<HomeAssistantApiManager>())
20-
.AddTransient(s => s.GetRequiredService<IHomeAssistantRunner>().CurrentConnection!)
21-
22-
23-
2420
.AddSingleton<IHomeAssistantConnectionProvider>(s => s.GetRequiredService<HomeAssistantRunner>())
2521
.AddTransient(s => s.GetRequiredService<IHomeAssistantConnectionProvider>().CurrentConnection!)
26-
2722
.AddWebSocketFactory()
2823
.AddPipelineFactory()
2924
.AddConnectionFactory()

src/Client/NetDaemon.HassClient/Common/IHomeAssistantRunner.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ public interface IHomeAssistantRunner : IHomeAssistantConnectionProvider, IAsync
1212
/// </summary>
1313
IObservable<DisconnectReason> OnDisconnect { get; }
1414

15-
/// <summary>
16-
/// The current connection to Home Assistant. Null if disconnected.
17-
/// </summary>
18-
IHomeAssistantConnection? CurrentConnection { get; }
19-
2015
/// <summary>
2116
/// Maintains a connection to the Home Assistant server
2217
/// </summary>

src/HassModel/NetDaemon.HassModel.Tests/Internal/AppScopedHaContextProviderTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,10 @@ private async Task<ServiceProvider> CreateServiceProvider()
363363
);
364364
serviceCollection.AddSingleton<IObservable<HassEvent>>(_hassEventSubjectMock);
365365

366-
var connectioProviderMock = new Mock<IHomeAssistantConnectionProvider>();
366+
var connectionProviderMock = new Mock<IHomeAssistantConnectionProvider>();
367367

368-
connectioProviderMock.SetupGet(n => n.CurrentConnection).Returns(_hassConnectionMock.Object);
369-
serviceCollection.AddSingleton(_ => connectioProviderMock.Object);
368+
connectionProviderMock.SetupGet(n => n.CurrentConnection).Returns(_hassConnectionMock.Object);
369+
serviceCollection.AddSingleton(_ => connectionProviderMock.Object);
370370

371371
var apiManagerMock = new Mock<IHomeAssistantApiManager>();
372372

src/HassModel/NetDaemon.HassModel/HaContextFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static class HaContextFactory
88
/// <summary>
99
/// Creates a new instance of <see cref="IHaContext"/> using the provided WebSocket URL and token.
1010
/// </summary>
11-
/// <remarks>Do not use this in NetDaemon apps. Apps should use UseNetDaemonRuntime and resolve IHaContext via dependency injection</remarks>
11+
/// <remarks>Do not use this in NetDaemon apps. Apps should use AddNetDaemonRuntime and resolve IHaContext via dependency injection. HaContextFactory</remarks>
1212
/// <param name="homeAssistantWebsocketUrl">The Websocket Url to HomeAssistant, eg: ws://localhost:8123/api/websocket</param>
1313
/// <param name="token">The long-lived access token for Home Assistant</param>
1414
/// <returns>An instance of IHaContext</returns>

src/HassModel/NetDaemon.HassModel/Internal/AppScopedHaContextProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public AppScopedHaContextProvider(
4444

4545
IHomeAssistantConnection CurrentConnection => _connectionProvider.CurrentConnection ?? throw new InvalidOperationException("No connection to Home Assistant");
4646

47-
4847
// By making the HaRegistry instance internal it can also be registered as scoped in the DI container and injected into applications
4948
internal HaRegistry Registry { get; }
5049

src/Runtime/NetDaemon.Runtime.Tests/Integration/TestRuntime.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ public async Task TestApplicationIsLoaded()
1616
var timedCancellationSource = new CancellationTokenSource(5000);
1717
var haRunner = new HomeAssistantRunnerMock();
1818

19-
var con1 = haRunner.Object.CurrentConnection;
20-
var run = haRunner.Object;
21-
var conprovider = run as IHomeAssistantConnectionProvider;
22-
var con2 = conprovider.CurrentConnection;
23-
24-
2519
var hostBuilder = GetDefaultHostBuilder();
2620
var host = hostBuilder.ConfigureServices((_, services) =>
2721
services

0 commit comments

Comments
 (0)