Skip to content

Commit

Permalink
Merge a71b91b into 7b1bff5
Browse files Browse the repository at this point in the history
  • Loading branch information
helto4real committed May 24, 2020
2 parents 7b1bff5 + a71b91b commit 9ff3dc1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/DaemonRunner/DaemonRunner/DaemonRunner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JoySoftware.HassClient" Version="0.5.0-beta" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.5.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.6.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.4" />
<PackageReference Include="YamlDotNet" Version="8.1.1" />
Expand Down
6 changes: 6 additions & 0 deletions src/DaemonRunner/DaemonRunner/HassioConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ public class HassioConfig
[JsonPropertyName("log_level")]
public string? LogLevel { get; set; }

[JsonPropertyName("project_folder")]
public string? ProjectFolder { get; set; }

[JsonPropertyName("log_messages")]
public bool? LogMessages { get; set; }

[JsonPropertyName("generate_entities")]
public bool? GenerateEntitiesOnStart { get; set; }
}
10 changes: 10 additions & 0 deletions src/DaemonRunner/DaemonRunner/Service/RunnerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ public static async Task Run(string[] args)
{
Environment.SetEnvironmentVariable("HASS_GEN_ENTITIES", hassAddOnSettings.GenerateEntitiesOnStart.ToString());
}
if (hassAddOnSettings.LogMessages is object && hassAddOnSettings.LogMessages == true)
{
Environment.SetEnvironmentVariable("HASSCLIENT_MSGLOGLEVEL", "Default");
}
if (hassAddOnSettings.ProjectFolder is object &&
string.IsNullOrEmpty(hassAddOnSettings.ProjectFolder) == false)
{
Environment.SetEnvironmentVariable("HASS_RUN_PROJECT_FOLDER", hassAddOnSettings.ProjectFolder);
}

// We are in Hassio so hard code the path
Environment.SetEnvironmentVariable("HASS_DAEMONAPPFOLDER", "/config/netdaemon");
}
Expand Down

0 comments on commit 9ff3dc1

Please sign in to comment.