Skip to content

Commit

Permalink
Fixed bug in Kasa MultiPlug toggle command, v1.8.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nicko88 committed Jul 6, 2023
1 parent fc25564 commit 101c5a8
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion HTWebRemote/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.1" newVersion="7.0.0.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
2 changes: 1 addition & 1 deletion HTWebRemote/Devices/Controllers/KasaControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private static async void ControlPowerStrip(string IP, string cmd, string param)
break;
case "toggle":
await powerStrip.Refresh();
await powerStrip.SetPoweredOn(!powerStrip.Outlets[Convert.ToInt32(values[0])].OutletPowered);
await powerStrip.SetPoweredOn(!powerStrip.Outlets[Convert.ToInt32(values[0])].OutletPowered, Convert.ToInt32(values[0]));
break;
default:
Util.ErrorHandler.SendError($"Unrecognized command: {param}");
Expand Down
9 changes: 4 additions & 5 deletions HTWebRemote/Forms/CommandEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public CommandEditor(RemoteEditor editor, List<Command> commands, string buttonL
Editor = editor;
Commands = commands;
ButtonIndex = buttonIndex;
this.Text = this.Text + $" - [{buttonLabel}]";
this.Text += $" - [{buttonLabel}]";
LoadCommands();

cmbDevices.DataSource = Devices.DeviceSelector.GetDeviceNames();
Expand Down Expand Up @@ -281,12 +281,11 @@ private void CommandEditor_FormClosing(object sender, FormClosingEventArgs e)

private void btnDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
string port = "5000";
try
string port = ConfigHelper.GetRegKey(@"SOFTWARE\HTWebRemote", "Port");
if(string.IsNullOrEmpty(port))
{
port = ConfigHelper.GetRegKey(@"SOFTWARE\HTWebRemote", "Port");
port = "5000";
}
catch { }

Process.Start($"http://{ConfigHelper.LocalIPAddress}:{port}/doc");
}
Expand Down
32 changes: 16 additions & 16 deletions HTWebRemote/HTWebRemote.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,26 @@
<Reference Include="Costura, Version=5.7.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.5.7.0\lib\netstandard1.0\Costura.dll</HintPath>
</Reference>
<Reference Include="Google.Apis, Version=1.60.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.1.60.0\lib\net45\Google.Apis.dll</HintPath>
<Reference Include="Google.Apis, Version=1.61.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.1.61.0\lib\net45\Google.Apis.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth, Version=1.60.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Auth.1.60.0\lib\net461\Google.Apis.Auth.dll</HintPath>
<Reference Include="Google.Apis.Auth, Version=1.61.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Auth.1.61.0\lib\net461\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.60.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Auth.1.60.0\lib\net461\Google.Apis.Auth.PlatformServices.dll</HintPath>
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.61.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Auth.1.61.0\lib\net461\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Core, Version=1.60.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Core.1.60.0\lib\net45\Google.Apis.Core.dll</HintPath>
<Reference Include="Google.Apis.Core, Version=1.61.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Core.1.61.0\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.PlatformServices, Version=1.60.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.1.60.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
<Reference Include="Google.Apis.PlatformServices, Version=1.61.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.1.61.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.YouTube.v3, Version=1.60.0.3064, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.YouTube.v3.1.60.0.3064\lib\net45\Google.Apis.YouTube.v3.dll</HintPath>
<Reference Include="Google.Apis.YouTube.v3, Version=1.61.0.3064, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.YouTube.v3.1.61.0.3064\lib\net45\Google.Apis.YouTube.v3.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.7.0.1\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
Expand Down Expand Up @@ -459,13 +459,13 @@
<Error Condition="!Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets'))" />
<Error Condition="!Exists('..\packages\Fody.6.7.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.7.0\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Fody.6.8.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.8.0\build\Fody.targets'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<Import Project="..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
<Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" />
<Import Project="..\packages\Fody.6.7.0\build\Fody.targets" Condition="Exists('..\packages\Fody.6.7.0\build\Fody.targets')" />
<Import Project="..\packages\Fody.6.8.0\build\Fody.targets" Condition="Exists('..\packages\Fody.6.8.0\build\Fody.targets')" />
</Project>
4 changes: 2 additions & 2 deletions HTWebRemote/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.2.0")]
[assembly: AssemblyFileVersion("1.8.2.0")]
[assembly: AssemblyVersion("1.8.2.1")]
[assembly: AssemblyFileVersion("1.8.2.1")]
[assembly: NeutralResourcesLanguage("en")]
14 changes: 7 additions & 7 deletions HTWebRemote/packages.config
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="5.7.0" targetFramework="net472" developmentDependency="true" />
<package id="Fody" version="6.7.0" targetFramework="net472" developmentDependency="true" />
<package id="Google.Apis" version="1.60.0" targetFramework="net472" />
<package id="Google.Apis.Auth" version="1.60.0" targetFramework="net472" />
<package id="Google.Apis.Core" version="1.60.0" targetFramework="net472" />
<package id="Google.Apis.YouTube.v3" version="1.60.0.3064" targetFramework="net472" />
<package id="Fody" version="6.8.0" targetFramework="net472" developmentDependency="true" />
<package id="Google.Apis" version="1.61.0" targetFramework="net472" />
<package id="Google.Apis.Auth" version="1.61.0" targetFramework="net472" />
<package id="Google.Apis.Core" version="1.61.0" targetFramework="net472" />
<package id="Google.Apis.YouTube.v3" version="1.61.0.3064" targetFramework="net472" />
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net472" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="7.0.0" targetFramework="net472" />
<package id="Microsoft.NETCore.Platforms" version="7.0.2" targetFramework="net472" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="7.0.1" targetFramework="net472" />
<package id="Microsoft.NETCore.Platforms" version="7.0.3" targetFramework="net472" />
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net472" />
<package id="MQTTnet" version="3.1.2" targetFramework="net472" />
<package id="NETStandard.Library" version="2.0.3" targetFramework="net472" />
Expand Down

0 comments on commit 101c5a8

Please sign in to comment.