nixos-configs/devices/homie/modules/home-assistant/netdaemon/program.cs
matt1432 b6c7d203bf
All checks were successful
Discord / discord commits (push) Has been skipped
feat(netd nvim): switch to omnisharp and add linter
2024-10-31 23:13:02 -04:00

36 lines
890 B
C#

using System;
using System.Reactive.Linq;
using System.Reflection;
using HomeAssistantGenerated;
using Microsoft.Extensions.Hosting;
using NetDaemon.AppModel;
using NetDaemon.Extensions.Logging;
using NetDaemon.Extensions.Scheduler;
using NetDaemon.Extensions.Tts;
using NetDaemon.Runtime;
try
{
await Host.CreateDefaultBuilder(args)
.UseNetDaemonDefaultLogging()
.UseNetDaemonRuntime()
.UseNetDaemonTextToSpeech()
.ConfigureServices(static (_, services) =>
services
.AddAppsFromAssembly(Assembly.GetExecutingAssembly())
.AddNetDaemonStateManager()
.AddNetDaemonScheduler()
.AddHomeAssistantGenerated()
)
.Build()
.RunAsync()
.ConfigureAwait(false);
}
catch (Exception e)
{
Console.WriteLine($"Failed to start host... {e}");
throw;
}