Skip to content

Commit

Permalink
v1.4.0-beta.14
Browse files Browse the repository at this point in the history
- Upgraded to MIG 1.2.9
- Upgraded to MIG.HomeAutomation 1.2.5
- Upgraded to MIG.Protocols 1.2.3
- Enabled message packing and binary I/O over websocket channel
- Fixed widget type "Color" changing to type "Dimmer" after page reload
  • Loading branch information
genemars committed Jan 13, 2023
1 parent 0826af4 commit be2c144
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 26 deletions.
9 changes: 9 additions & 0 deletions assets/build/all/app/3rdpartylicenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,15 @@ SOFTWARE.
@larscom/ngx-translate-module-loader
MIT

@msgpack/msgpack
ISC
Copyright 2019 The MessagePack Community.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


@ngstack/code-editor
MIT
MIT License
Expand Down
2 changes: 1 addition & 1 deletion assets/build/all/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@

</div>

<script src="runtime.b92e2ca178ebbf4a.js" type="module"></script><script src="polyfills.710b144f4805f4b0.js" type="module"></script><script src="main.b2912564c4639629.js" type="module"></script>
<script src="runtime.b92e2ca178ebbf4a.js" type="module"></script><script src="polyfills.710b144f4805f4b0.js" type="module"></script><script src="main.9079c34029d7bbef.js" type="module"></script>

</body></html>
1 change: 1 addition & 0 deletions assets/build/all/app/main.9079c34029d7bbef.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion assets/build/all/app/main.b2912564c4639629.js

This file was deleted.

8 changes: 4 additions & 4 deletions assets/build/all/app/ngsw.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configVersion": 1,
"timestamp": 1673465988813,
"timestamp": 1673649665503,
"index": "/app/index.html",
"assetGroups": [
{
Expand All @@ -15,7 +15,7 @@
"/app/613.16b9c52c0ae74833.js",
"/app/859.0f150be9c99a6b5a.js",
"/app/index.html",
"/app/main.b2912564c4639629.js",
"/app/main.9079c34029d7bbef.js",
"/app/manifest.webmanifest",
"/app/polyfills.710b144f4805f4b0.js",
"/app/runtime.b92e2ca178ebbf4a.js",
Expand Down Expand Up @@ -704,8 +704,8 @@
"/app/assets/widgets/weather/images_alt/weather.svg": "73ab65b876b20b345dd8f397550fcf9226cad7c1",
"/app/assets/widgets/weather/style.css": "1b70730e73885cc0ee83566eaf584008d34e2255",
"/app/assets/workers/typings-worker.js": "be92b854a22224e5f740eafedea86523affc1ff2",
"/app/index.html": "31ac8c69ae16274fd0fed235e08c2224ab92b849",
"/app/main.b2912564c4639629.js": "84a14d144ef855770ff428ba73f56d17667ad871",
"/app/index.html": "ac77faca8e524983a1f84c0d0961bbcd46814716",
"/app/main.9079c34029d7bbef.js": "a60077aeadedb3136923908d5cb4aadd63d5bd15",
"/app/manifest.webmanifest": "d47bb07a495e27ddf072f8702df373f79b4eb183",
"/app/polyfills.710b144f4805f4b0.js": "594a5ea1b9d3f9cbc4f363eca84eda2c8bb8a901",
"/app/runtime.b92e2ca178ebbf4a.js": "b50d841a4c50d466c34aab3267d3fb4afe87dede",
Expand Down
Binary file modified assets/build/all/homegenie_factory_config.zip
Binary file not shown.
1 change: 1 addition & 0 deletions assets/build/all/systemconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<Options>
<Option Name="Port" Value="8188" />
<Option Name="Authentication" Value="Token" />
<Option Name="MessagePack" Value="true" />
</Options>
</Gateway>
</Gateways>
Expand Down
15 changes: 8 additions & 7 deletions src/HomeGenie/Automation/Scripting/ProgramHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ You should have received a copy of the GNU General Public License
using HomeGenie.Data;
using HomeGenie.Service;
using HomeGenie.Service.Constants;
using MIG.Interfaces.HomeAutomation.Commons;

namespace HomeGenie.Automation.Scripting
{
Expand Down Expand Up @@ -177,7 +178,7 @@ public ProgramHelper UseWidget(string widget)
Domain = myProgramDomain,
Address = myProgramId.ToString(),
Name = (program != null ? program.Name : ""),
DeviceType = MIG.ModuleTypes.Program
DeviceType = ModuleTypes.Program
};
homegenie.VirtualModules.Add(module);
}
Expand Down Expand Up @@ -361,7 +362,7 @@ public ProgramHelper AddModule(string domain, string address, string type, strin
homegenie.Modules.Find(o => o.Domain == virtualModule.Domain && o.Address == virtualModule.Address);
if (module != null)
{
if (module.DeviceType == MIG.ModuleTypes.Generic)
if (module.DeviceType == ModuleTypes.Generic)
{
module.DeviceType = virtualModule.DeviceType;
}
Expand Down Expand Up @@ -402,7 +403,7 @@ public ProgramHelper AddModules(
Module module = homegenie.Modules.Find(o => o.Domain == virtualModule.Domain && o.Address == virtualModule.Address);
if (module != null)
{
if (module.DeviceType == MIG.ModuleTypes.Generic)
if (module.DeviceType == ModuleTypes.Generic)
{
module.DeviceType = virtualModule.DeviceType;
}
Expand Down Expand Up @@ -867,8 +868,8 @@ private VirtualModule AddProgramModule(string domain, string address, string typ
ParentId = myProgramId.ToString(),
Domain = domain,
Address = address,
DeviceType = (MIG.ModuleTypes)Enum.Parse(
typeof(MIG.ModuleTypes),
DeviceType = (ModuleTypes)Enum.Parse(
typeof(ModuleTypes),
type
)
};
Expand All @@ -883,8 +884,8 @@ private VirtualModule AddProgramModule(string domain, string address, string typ
{
virtualModule.IsActive = true;
virtualModule.Domain = domain;
if (virtualModule.DeviceType == MIG.ModuleTypes.Generic)
virtualModule.DeviceType = (MIG.ModuleTypes)Enum.Parse(typeof(MIG.ModuleTypes), type);
if (virtualModule.DeviceType == ModuleTypes.Generic)
virtualModule.DeviceType = (ModuleTypes)Enum.Parse(typeof(ModuleTypes), type);
Utility.ModuleParameterSet(virtualModule, Properties.WidgetDisplayModule, widget);
}

Expand Down
5 changes: 1 addition & 4 deletions src/HomeGenie/Data/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ You should have received a copy of the GNU General Public License
*/

using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

using MIG;

using HomeGenie.Service;
using MIG.Interfaces.HomeAutomation.Commons;

namespace HomeGenie.Data
{
Expand Down
7 changes: 3 additions & 4 deletions src/HomeGenie/HomeGenie.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PackageReference Include="Iot.Device.Bindings" Version="2.2.0" />
<PackageReference Include="KNX.net" Version="1.1.10" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="6.0.7" />
<PackageReference Include="MIG.HomeAutomation" Version="1.2.4" />
<PackageReference Include="MIG" Version="1.2.9" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="SerialPortStream" Version="2.4.0" />
<PackageReference Include="SharpZipLib" Version="1.4.1" />
Expand All @@ -42,9 +42,8 @@

<PackageReference Include="MQTTnet" Version="4.1.4.563" />
<PackageReference Include="SerialPortLib" Version="1.1.1" />

<PackageReference Include="MIG" Version="1.2.7" />
<PackageReference Include="MIG.Protocols" Version="1.2.1" />
<PackageReference Include="MIG.HomeAutomation" Version="1.2.5" />
<PackageReference Include="MIG.Protocols" Version="1.2.3" />

<PackageReference Include="HG.Raspberry.IO.Components" Version="2.4.11" />
<PackageReference Include="HG.Raspberry.IO.GeneralPurpose" Version="2.4.11" />
Expand Down
3 changes: 2 additions & 1 deletion src/HomeGenie/Service/Handlers/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ You should have received a copy of the GNU General Public License

using MIG.Gateways;
using MIG.Gateways.Authentication;
using MIG.Interfaces.HomeAutomation.Commons;

namespace HomeGenie.Service.Handlers
{
Expand All @@ -69,7 +70,7 @@ public void ProcessRequest(MigClientRequest request)
var migCommand = request.Command;

string remoteEndpoint = "local";
if (request.Context != null && request.Context.Data != null)
if (request.Context != null && request.Context.Data is HttpListenerContext)
{
remoteEndpoint = (request.Context.Data as HttpListenerContext).Request.RemoteEndPoint.ToString();
}
Expand Down
8 changes: 4 additions & 4 deletions src/HomeGenie/Service/HomeGenieService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ You should have received a copy of the GNU General Public License
using MIG;
using MIG.Gateways;
using MIG.Gateways.Authentication;

using MIG.Interfaces.HomeAutomation.Commons;
using NLog;

using Module = HomeGenie.Data.Module;
Expand Down Expand Up @@ -398,7 +398,7 @@ public bool ExecuteAutomationRequest(MigInterfaceCommand command)
for (int m = 0; m < group.Modules.Count; m++)
{
var module = Modules.Find(mod => mod.Domain == group.Modules[m].Domain && mod.Address == group.Modules[m].Address);
if (module != null && (module.DeviceType == MIG.ModuleTypes.Light || module.DeviceType == MIG.ModuleTypes.Dimmer))
if (module != null && (module.DeviceType == ModuleTypes.Light || module.DeviceType == ModuleTypes.Dimmer))
{
try
{
Expand Down Expand Up @@ -1335,9 +1335,9 @@ private void modules_RefreshInterface(MigInterface iface)
{
module.Description = migModule.Description;
}
if (module.DeviceType == ModuleTypes.Generic)
if (module.DeviceType == ModuleTypes.Generic && migModule.CustomData != null && migModule.CustomData.Type != null)
{
module.DeviceType = migModule.ModuleType;
module.DeviceType = migModule.CustomData.Type;
}
}
}
Expand Down

0 comments on commit be2c144

Please sign in to comment.