Skip to content

Commit

Permalink
Merge pull request #95 from qJake/fix-94
Browse files Browse the repository at this point in the history
Fix 94
  • Loading branch information
qJake committed Apr 16, 2020
2 parents 0b5d13d + 5c56bbf commit 69bc6a3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 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.18'
$version = '1.0.19'

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.18.0</AssemblyVersion>
<FileVersion>1.0.18.0</FileVersion>
<AssemblyVersion>1.0.19.0</AssemblyVersion>
<FileVersion>1.0.19.0</FileVersion>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Deterministic>false</Deterministic>
Expand Down
9 changes: 8 additions & 1 deletion HADotNet.CommandCenter/Models/Config/Tiles/SwitchTile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public class SwitchTile : BaseEntityTile
/// <remarks>Switches are weird... some of them don't like the homeassistant.toggle service. So we do our own logic.</remarks>
public override async Task OnClick(ServiceClient serviceClient)
{
var serviceDomain = EntityId.Split('.')[0].ToLower();
if (serviceDomain.ToUpper() == "GROUP")
{
serviceDomain = "homeassistant";
}

var stateClient = ClientFactory.GetClient<StatesClient>();
var state = await stateClient.GetState(EntityId);
var serviceName =
Expand All @@ -54,7 +60,8 @@ public override async Task OnClick(ServiceClient serviceClient)
|| state.State.ToUpper() == "STANDBY"
|| state.State.ToUpper() == "IDLE"
? "turn_on" : "turn_off";
await serviceClient.CallService(EntityId.Split('.')[0].ToLower(), serviceName, new { entity_id = EntityId });

await serviceClient.CallService(serviceDomain, serviceName, new { entity_id = EntityId });
}
}
}
4 changes: 2 additions & 2 deletions HADotNet.CommandCenter/Views/Shared/_AdminLayout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

<environment include="Development">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.7.8/semantic.css" integrity="sha256-RA4g7qvjtBTtZXeL6LEnJJP0nkcy3ZsDcEFFRx3DBCE=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/3.9.97/css/materialdesignicons.css" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/5.0.45/css/materialdesignicons.css" crossorigin="anonymous" />
<link type="text/css" rel="stylesheet" href="~/css/admin.css" asp-append-version="true" />
</environment>
<environment include="Staging,Production">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.7.8/semantic.min.css" integrity="sha256-pquaucmYjfUqK251HC4uCXIKb2TQ4brXeUN2STYrJeg=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/3.9.97/css/materialdesignicons.min.css" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/5.0.45/css/materialdesignicons.min.css" crossorigin="anonymous" />
<link type="text/css" rel="stylesheet" href="~/css/admin.min.css" asp-append-version="true" />
</environment>

Expand Down
4 changes: 2 additions & 2 deletions HADotNet.CommandCenter/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<title>@ViewData["Title"] - HA Command Center</title>

<environment include="Development">
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/3.9.97/css/materialdesignicons.css" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/5.0.45/css/materialdesignicons.css" crossorigin="anonymous" />
<link type="text/css" rel="stylesheet" href="~/css/dashboard.css" asp-append-version="true" />
</environment>
<environment include="Staging,Production">
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/3.9.97/css/materialdesignicons.min.css" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/5.0.45/css/materialdesignicons.min.css" crossorigin="anonymous" />
<link type="text/css" rel="stylesheet" href="~/css/dashboard.min.css" asp-append-version="true" />
</environment>

Expand Down

0 comments on commit 69bc6a3

Please sign in to comment.