Skip to content

Commit

Permalink
testing source deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
helto4real authored and FrankBakkerNl committed Oct 26, 2023
1 parent 3beac92 commit f1e97e6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/debug/DebugHost/DebugHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\AppModel\NetDaemon.AppModel\NetDaemon.AppModel.csproj" />
<ProjectReference Include="..\..\AppModel\NetDaemon.AppModel.SourceDeployedApps\NetDaemon.AppModel.SourceDeployedApps.csproj" />
<ProjectReference Include="..\..\Extensions\NetDaemon.Extensions.Logging\NetDaemon.Extensions.Logging.csproj" />
<ProjectReference Include="..\..\Extensions\NetDaemon.Extensions.MqttEntityManager\NetDaemon.Extensions.MqttEntityManager.csproj" />
<ProjectReference Include="..\..\Extensions\NetDaemon.Extensions.Tts\NetDaemon.Extensions.Tts.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions src/debug/DebugHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
try
{
await Host.CreateDefaultBuilder(args)
//.UseNetDaemonAppSettings()
.UseNetDaemonAppSettings()
.UseNetDaemonDefaultLogging()
.UseNetDaemonRuntime()
.UseNetDaemonTextToSpeech()
Expand All @@ -34,4 +34,4 @@ await Host.CreateDefaultBuilder(args)
{
Console.WriteLine($"Failed to start host... {e}");
throw;
}
}
31 changes: 31 additions & 0 deletions src/debug/DebugHost/apps_src/hellow.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Reactive.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using NetDaemon.AppModel;
using NetDaemon.HassModel;

namespace Apps;

[NetDaemonApp]
[Focus]
public sealed class HelloAppSrc : IAsyncDisposable
{
private readonly ILogger<HelloApp> _logger;

public HelloAppSrc(IHaContext ha, ILogger<HelloApp> logger)
{
_logger = logger;
ha?.Events.Where(n => n.EventType == "test_event").Subscribe( n =>
{
logger.LogInformation("Hello testevent");
});
ha?.CallService("notify", "persistent_notification", data: new { message = "Notify me", title = "Hello world!" });
}

public ValueTask DisposeAsync()
{
_logger.LogInformation("disposed app");
return ValueTask.CompletedTask;
}
}

0 comments on commit f1e97e6

Please sign in to comment.