Skip to content

Commit

Permalink
Merge pull request #63 from qJake/project-updates
Browse files Browse the repository at this point in the history
1.0.5: Websocket connection fix
  • Loading branch information
qJake authored Feb 8, 2020
2 parents e53600b + 300c6aa commit 4ca147d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Docker/BuildHaccContainers.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$version = '1.0.4'
$version = '1.0.5'

function Test-ExitCode ([int] $Expected = 0)
{
Expand Down
4 changes: 2 additions & 2 deletions HADotNet.CommandCenter/HADotNet.CommandCenter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<RuntimeIdentifiers>win10;alpine.3.10-x64;debian.10-arm</RuntimeIdentifiers>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<AssemblyVersion>1.0.4.0</AssemblyVersion>
<FileVersion>1.0.4.0</FileVersion>
<AssemblyVersion>1.0.5.0</AssemblyVersion>
<FileVersion>1.0.5.0</FileVersion>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Deterministic>false</Deterministic>
Expand Down
5 changes: 5 additions & 0 deletions HADotNet.CommandCenter/Models/Config/SystemSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ public class SystemSettings
/// Gets or sets whether or not this is a Hass.io addon environment. Set automatically when initialized from a Hass.io addon container.
/// </summary>
public bool IsHassIo { get; set; }

/// <summary>
/// Gets the Websocket URL.
/// </summary>
public string WebsocketUri => !string.IsNullOrWhiteSpace(OverrideAssetUri) ? OverrideAssetUri : IsHassIo && !string.IsNullOrWhiteSpace(ExternalBaseUri) ? ExternalBaseUri : BaseUri;
}
}
4 changes: 2 additions & 2 deletions HADotNet.CommandCenter/Views/Dashboard/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@
<script>
window.ccOptions.autoReturn = @Model.CurrentPage.AutoReturnSeconds;
window.ccOptions.pageId = '@Model.CurrentPage.Name';
window.ccOptions.baseUrl = '@Model.SystemSettings.BaseUri';
window.ccOptions.socketUrl = '@(Model.SystemSettings.IsHassIo ? "http://hassio/homeassistant/websocket" : Model.SystemSettings.BaseUri)';
window.ccOptions.baseUrl = '@(Model.SystemSettings.ExternalBaseUri ?? Model.SystemSettings.BaseUri)';
window.ccOptions.socketUrl = '@Model.SystemSettings.WebsocketUri';
window.ccOptions.overrideAssetUrl = '@Model.SystemSettings.OverrideAssetUri';
window.ccOptions.token = '@Model.SystemSettings.AccessToken';
</script>
Expand Down

0 comments on commit 4ca147d

Please sign in to comment.