File tree Expand file tree Collapse file tree 5 files changed +21
-16
lines changed
DaemonRunner/DaemonRunner Expand file tree Collapse file tree 5 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ The following environment variables are available to identify your Home Assistan
3434
3535Example giving:
3636```
37- docker run -d \
37+ docker run -dt \
3838 --name netdaemon \
3939 --restart=always \
4040 -e HASS_HOST=192.168.1.1 \
Original file line number Diff line number Diff line change 2323 </PropertyGroup >
2424
2525 <ItemGroup >
26- <PackageReference Include =" JoySoftware.HassClient" Version =" 0.0.31 -alpha" />
26+ <PackageReference Include =" JoySoftware.HassClient" Version =" 0.1.0 -alpha" />
2727 <PackageReference Include =" Microsoft.Extensions.Logging.Abstractions" Version =" 3.1.1" />
2828 </ItemGroup >
2929
Original file line number Diff line number Diff line change 2020
2121 </PropertyGroup >
2222 <ItemGroup >
23- <PackageReference Include =" JoySoftware.HassClient" Version =" 0.0.31 -alpha" />
23+ <PackageReference Include =" JoySoftware.HassClient" Version =" 0.1.0 -alpha" />
2424 <PackageReference Include =" Microsoft.Extensions.Hosting" Version =" 3.1.3" />
2525 </ItemGroup >
2626 <ItemGroup >
Original file line number Diff line number Diff line change 2121
2222 </PropertyGroup >
2323 <ItemGroup >
24- <PackageReference Include =" JoySoftware.HassClient" Version =" 0.0.31 -alpha" />
24+ <PackageReference Include =" JoySoftware.HassClient" Version =" 0.1.0 -alpha" />
2525 <PackageReference Include =" Microsoft.CodeAnalysis.CSharp" Version =" 3.5.0" />
2626 <!-- <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="3.5.0-beta2-final" /> -->
2727 <PackageReference Include =" Microsoft.Extensions.Hosting" Version =" 3.1.3" />
Original file line number Diff line number Diff line change @@ -67,26 +67,31 @@ public static async Task Main(string[] args)
6767 . MinimumLevel . Is ( Program . LogLevel )
6868 . WriteTo . Console ( theme : AnsiConsoleTheme . Code )
6969 . CreateLogger ( ) ;
70+
71+ CreateHostBuilder ( args ) . Build ( ) . Run ( ) ;
7072 }
7173 catch ( Exception e )
7274 {
7375 Log . Fatal ( e , "Home assistant add-on config not valid json, ending add-on..." ) ;
74- return ;
7576 }
76-
77- CreateHostBuilder ( args ) . Build ( ) . Run ( ) ;
77+ finally
78+ {
79+ Log . CloseAndFlush ( ) ;
80+ }
7881 }
7982
8083 public static IHostBuilder CreateHostBuilder ( string [ ] args ) =>
8184 Host . CreateDefaultBuilder ( args )
82- . ConfigureServices ( services => { services . AddHostedService < RunnerService > ( ) ; } )
83- . ConfigureLogging ( logging =>
84- {
85- logging . ClearProviders ( ) ;
86- // logging.AddConsole(options => options.IncludeScopes = false);
87- // logging.AddDebug();
88- // logging.AddFilter("Microsoft", LogLevel.Error);
89- logging . AddSerilog ( ) ;
90- } ) ;
85+ . UseSerilog ( )
86+ . ConfigureServices ( services => { services . AddHostedService < RunnerService > ( ) ; } ) ;
87+ // .ConfigureLogging(logging =>
88+ // {
89+ // logging.ClearProviders();
90+ // // logging.AddConsole(options => options.IncludeScopes = false);
91+ // // logging.AddDebug();
92+ // // logging.AddFilter("Microsoft", LogLevel.Error);
93+ // logging.AddSerilog();
94+ // }
95+ // );
9196 }
9297}
You can’t perform that action at this time.
0 commit comments