Skip to content

Commit

Permalink
Fix #321 (modules delete); Updated MIG and related packages
Browse files Browse the repository at this point in the history
  • Loading branch information
genemars committed Dec 26, 2018
1 parent 1e2d086 commit 6913594
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
8 changes: 4 additions & 4 deletions HomeGenie/HomeGenie.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CM19Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>packages\CM19Lib.1.1.2\lib\CM19Lib.dll</HintPath>
<HintPath>packages\CM19Lib.1.1.3\lib\CM19Lib.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CommonMark, Version=0.1.0.0, Culture=neutral, PublicKeyToken=001ef8810438905d">
Expand Down Expand Up @@ -123,11 +123,11 @@
<Private>True</Private>
</Reference>
<Reference Include="MIG, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>packages\MIG.1.0.8\lib\MIG.dll</HintPath>
<HintPath>packages\MIG.1.0.9\lib\MIG.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MIG.HomeAutomation, Version=1.0.6931.37409, Culture=neutral, PublicKeyToken=null">
<HintPath>packages\MIG.HomeAutomation.1.0.9\lib\MIG.HomeAutomation.dll</HintPath>
<Reference Include="MIG.HomeAutomation, Version=1.0.6933.24089, Culture=neutral, PublicKeyToken=null">
<HintPath>packages\MIG.HomeAutomation.1.0.10\lib\MIG.HomeAutomation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MIG.Protocols, Version=1.0.6841.32282, Culture=neutral, PublicKeyToken=null">
Expand Down
9 changes: 3 additions & 6 deletions HomeGenie/Service/Handlers/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -755,17 +755,14 @@ public void ProcessRequest(MigClientRequest request)
break;

case "Modules.Delete":
var deletedModule = homegenie.Modules.Find(m => m.Domain == migCommand.GetOption(0) && m.Address == migCommand.GetOption(1));
if (deletedModule != null)
{
homegenie.Modules.Remove(deletedModule);
}
homegenie.Modules.RemoveAll(m => m.Domain == migCommand.GetOption(0) && m.Address == migCommand.GetOption(1));
homegenie.VirtualModules.RemoveAll(m => m.Domain == migCommand.GetOption(0) && m.Address == migCommand.GetOption(1));
request.ResponseData = new ResponseText("OK");
//
homegenie.UpdateModulesDatabase();
break;

case "Stores.List":
case "Stores.List":
{
var module = homegenie.Modules.Find(m => m.Domain == migCommand.GetOption(0) && m.Address == migCommand.GetOption(1));
if (module != null)
Expand Down
8 changes: 4 additions & 4 deletions HomeGenie/Service/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ public object LockObject
base.Add(value);
}

public new void RemoveAll(Predicate<T> predicate)
public new int RemoveAll(Predicate<T> predicate)
{
lock (syncLock)
base.RemoveAll(predicate);
return base.RemoveAll(predicate);
}

public new void Remove(T item)
public new bool Remove(T item)
{
lock (syncLock)
base.Remove(item);
return base.Remove(item);
}

public new void Sort(Comparison<T> comparison)
Expand Down
6 changes: 3 additions & 3 deletions HomeGenie/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="CM19Lib" version="1.1.2" targetFramework="net45" />
<package id="CM19Lib" version="1.1.3" targetFramework="net45" />
<package id="CommonMark.NET" version="0.15.1" targetFramework="net45" />
<package id="DynamicLanguageRuntime" version="1.2.2" targetFramework="net45" />
<package id="IronPython" version="2.7.9" targetFramework="net45" />
<package id="Jint" version="2.11.58" targetFramework="net45" />
<package id="LibUsbDotNet" version="2.2.8" targetFramework="net45" />
<package id="M2Mqtt" version="4.3.0.0" targetFramework="net45" />
<package id="MIG" version="1.0.8" targetFramework="net45" />
<package id="MIG.HomeAutomation" version="1.0.9" targetFramework="net45" />
<package id="MIG" version="1.0.9" targetFramework="net45" />
<package id="MIG.HomeAutomation" version="1.0.10" targetFramework="net45" />
<package id="MIG.Protocols" version="1.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
<package id="NLog" version="4.5.10" targetFramework="net45" />
Expand Down

0 comments on commit 6913594

Please sign in to comment.