Skip to content

Commit

Permalink
Merge c26785b into 8fee408
Browse files Browse the repository at this point in the history
  • Loading branch information
helto4real committed Apr 11, 2020
2 parents 8fee408 + c26785b commit b8f0553
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The following environment variables are available to identify your Home Assistan

Example giving:
```
docker run -d \
docker run -dt \
--name netdaemon \
--restart=always \
-e HASS_HOST=192.168.1.1 \
Expand Down
2 changes: 1 addition & 1 deletion src/App/NetDaemon.App/NetDaemon.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JoySoftware.HassClient" Version="0.0.31-alpha" />
<PackageReference Include="JoySoftware.HassClient" Version="0.1.0-alpha" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Daemon/NetDaemon.Daemon/NetDaemon.Daemon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

</PropertyGroup>
<ItemGroup>
<PackageReference Include="JoySoftware.HassClient" Version="0.0.31-alpha" />
<PackageReference Include="JoySoftware.HassClient" Version="0.1.0-alpha" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.3" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/DaemonRunner/DaemonRunner/DaemonRunner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

</PropertyGroup>
<ItemGroup>
<PackageReference Include="JoySoftware.HassClient" Version="0.0.31-alpha" />
<PackageReference Include="JoySoftware.HassClient" Version="0.1.0-alpha" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.5.0" />
<!-- <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="3.5.0-beta2-final" /> -->
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.3" />
Expand Down
29 changes: 17 additions & 12 deletions src/Service/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,31 @@ public static async Task Main(string[] args)
.MinimumLevel.Is(Program.LogLevel)
.WriteTo.Console(theme: AnsiConsoleTheme.Code)
.CreateLogger();

CreateHostBuilder(args).Build().Run();
}
catch (Exception e)
{
Log.Fatal(e, "Home assistant add-on config not valid json, ending add-on...");
return;
}

CreateHostBuilder(args).Build().Run();
finally
{
Log.CloseAndFlush();
}
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices(services => { services.AddHostedService<RunnerService>(); })
.ConfigureLogging(logging =>
{
logging.ClearProviders();
// logging.AddConsole(options => options.IncludeScopes = false);
// logging.AddDebug();
// logging.AddFilter("Microsoft", LogLevel.Error);
logging.AddSerilog();
});
.UseSerilog()
.ConfigureServices(services => { services.AddHostedService<RunnerService>(); });
// .ConfigureLogging(logging =>
// {
// logging.ClearProviders();
// // logging.AddConsole(options => options.IncludeScopes = false);
// // logging.AddDebug();
// // logging.AddFilter("Microsoft", LogLevel.Error);
// logging.AddSerilog();
// }
// );
}
}

0 comments on commit b8f0553

Please sign in to comment.