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