Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 94 #95

Merged
merged 3 commits into from
Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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