Skip to content

Commit

Permalink
v1.4.0-beta.68
Browse files Browse the repository at this point in the history
- Fix major bug in Scheduler Wizard UI
- Added "Set color" command preset in Scheduler Wizard UI
- Added special "Events.Disable" module property to disable propagation of emitted values
- Updated packages
  • Loading branch information
genemars committed Apr 14, 2024
1 parent 66da29d commit 237cc2a
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$$.boundModules.colorHsb = '$color$';
18 changes: 18 additions & 0 deletions assets/build/all/app/assets/editor/templates/scheduler/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@
}
}
},
{
"name": {
"en": "Set Color",
"it": "Imposta colore"
},
"script": "command.set-color.js",
"config": {
"color": {
"name": {
"en": "Color",
"it": "Colore"
},
"type": "color",
"value": "#ff00ff",
"transform": "rgb:hsb"
}
}
},
{
"name": {
"en": "Thermostat Mode",
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 @@ -56,6 +56,6 @@

</div>

<script src="runtime.b92e2ca178ebbf4a.js" type="module"></script><script src="polyfills.a360d6e45b80c065.js" type="module"></script><script src="scripts.0dcb4f0a61221c18.js" defer></script><script src="main.49815379fe77728a.js" type="module"></script>
<script src="runtime.b92e2ca178ebbf4a.js" type="module"></script><script src="polyfills.a360d6e45b80c065.js" type="module"></script><script src="scripts.0dcb4f0a61221c18.js" defer></script><script src="main.e731d91cd2efa567.js" type="module"></script>

</body></html>
1 change: 0 additions & 1 deletion assets/build/all/app/main.49815379fe77728a.js

This file was deleted.

1 change: 1 addition & 0 deletions assets/build/all/app/main.e731d91cd2efa567.js

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions assets/build/all/app/ngsw.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configVersion": 1,
"timestamp": 1705173170747,
"timestamp": 1713056226952,
"index": "/app/index.html",
"assetGroups": [
{
Expand All @@ -15,7 +15,7 @@
"/app/613.16b9c52c0ae74833.js",
"/app/859.0f150be9c99a6b5a.js",
"/app/index.html",
"/app/main.49815379fe77728a.js",
"/app/main.e731d91cd2efa567.js",
"/app/manifest.webmanifest",
"/app/polyfills.a360d6e45b80c065.js",
"/app/runtime.b92e2ca178ebbf4a.js",
Expand Down Expand Up @@ -62,6 +62,7 @@
"/app/assets/blockly/sprites.svg",
"/app/assets/editor/homegenie-js-api.js",
"/app/assets/editor/homegenie-js-app-api.js",
"/app/assets/editor/templates/scheduler/command.set-color.js",
"/app/assets/editor/templates/scheduler/command.set-level.js",
"/app/assets/editor/templates/scheduler/command.thermostat-mode.js",
"/app/assets/editor/templates/scheduler/command.turn-off.js",
Expand Down Expand Up @@ -430,11 +431,12 @@
"/app/assets/blockly/sprites.svg": "a68d56b1c26da3e55d6e04699cceec36ea6d4a99",
"/app/assets/editor/homegenie-js-api.js": "e9260df8f266686f66a139f134b1c3b54270f0c3",
"/app/assets/editor/homegenie-js-app-api.js": "afc158ca5dfd4ecf73fb4f5abdf50d323fdfc804",
"/app/assets/editor/templates/scheduler/command.set-color.js": "f2c2d7479570bb5d5f43d236c18ded0ee116bbbc",
"/app/assets/editor/templates/scheduler/command.set-level.js": "b3ec73252b541b23694afeab76ecf1009b0906be",
"/app/assets/editor/templates/scheduler/command.thermostat-mode.js": "47e580a75d1cc5f83716b9a829e45fac8cd30904",
"/app/assets/editor/templates/scheduler/command.turn-off.js": "bb1bab852c09316ff93601c9a13567e78817298c",
"/app/assets/editor/templates/scheduler/command.turn-on.js": "b01c56791688cae4bdf280068cce2542ec0295ca",
"/app/assets/editor/templates/scheduler/index.json": "66e62ffa96cb20edb002f2eee3c7e85126d5c3dd",
"/app/assets/editor/templates/scheduler/index.json": "9f0d33f394cb084dfbce9f6214d30c31f8520356",
"/app/assets/editor/templates/scheduler/program.run.js": "e7321a577e8077ea079b200841a09d7e2386cd2c",
"/app/assets/editor/templates/scheduler/program.say.js": "04708640bce376116fe084d3521d8093f8b1d495",
"/app/assets/editor/zuix.d.ts": "7ce5c4b102e846602502210d6fe58edd4c662d40",
Expand Down Expand Up @@ -759,8 +761,8 @@
"/app/assets/widgets/weather/images_alt/thunder.svg": "2ace7038dfd663330cecc350d680ef08206d62ff",
"/app/assets/widgets/weather/images_alt/weather.svg": "c719c09048977fd40688272316b35ddf1bdf89e8",
"/app/assets/workers/typings-worker.js": "8df10d867c12d36cdebfb7e16caacd0020db301f",
"/app/index.html": "85fb01518d2cfa9ed995ac892111bd64c23c02c6",
"/app/main.49815379fe77728a.js": "165bf139a84a35d6d342eb90f9eb6788e6962b07",
"/app/index.html": "5e3fe5626137482fbedeb7a8a972b6bad6eacf73",
"/app/main.e731d91cd2efa567.js": "9dd54e1d31fab12ebe9a998592e66dbafadbf35d",
"/app/manifest.webmanifest": "d47bb07a495e27ddf072f8702df373f79b4eb183",
"/app/polyfills.a360d6e45b80c065.js": "f317e1a3e4bb6a84068c7e1845a2ce8b2f956ee7",
"/app/runtime.b92e2ca178ebbf4a.js": "b50d841a4c50d466c34aab3267d3fb4afe87dede",
Expand Down
4 changes: 2 additions & 2 deletions src/HomeGenie/Automation/Scheduler/SchedulerScriptingHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public ModulesManager BoundModules
get
{
var boundModulesManager = new ModulesManager(homegenie);
boundModulesManager.ModulesListCallback = new Func<ModulesManager, TsList<Module>>((sender) =>
boundModulesManager.ModulesListCallback = (sender) =>
{
TsList<Module> modules = new TsList<Module>();
foreach (var m in schedulerItem.BoundModules)
Expand All @@ -141,7 +141,7 @@ public ModulesManager BoundModules
modules.Add(mod);
}
return modules;
});
};
return boundModulesManager;
}
}
Expand Down
11 changes: 0 additions & 11 deletions src/HomeGenie/Automation/Scheduler/SchedulerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,6 @@ public SchedulerItem AddOrUpdate(string name, string cronExpression, string data
return eventItem;
}

public bool SetData(string name, string jsonData)
{
var eventItem = Get(name);
if (eventItem != null)
{
eventItem.Data = jsonData;
return true;
}
return false;
}

public bool SetScript(string name, string script)
{
var eventItem = Get(name);
Expand Down
4 changes: 2 additions & 2 deletions src/HomeGenie/Automation/Scripting/MqttClientHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public MqttClientHelper Publish(string topic, string message)
{
mqttClient.PublishAsync(new MqttApplicationMessage()
{
Topic =topic,
Topic = topic,
PayloadSegment = new ArraySegment<byte>(Encoding.UTF8.GetBytes(message)),
QualityOfServiceLevel = MqttQualityOfServiceLevel.AtLeastOnce,
Retain = false
Expand All @@ -270,7 +270,7 @@ public MqttClientHelper Publish(string topic, byte[] message)
{
mqttClient.PublishAsync(new MqttApplicationMessage()
{
Topic =topic,
Topic = topic,
PayloadSegment = new ArraySegment<byte>(message),
QualityOfServiceLevel = MqttQualityOfServiceLevel.AtLeastOnce,
Retain = false
Expand Down
16 changes: 8 additions & 8 deletions src/HomeGenie/HomeGenie.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@
<PackageReference Include="CommonMark.NET" Version="0.15.1" />
<PackageReference Include="HG.NWaves" Version="0.9.6" />
<PackageReference Include="HG.Raspberry.IO.SerialPeripheralInterface" Version="2.4.11" />
<PackageReference Include="Iot.Device.Bindings" Version="3.0.0" />
<PackageReference Include="Iot.Device.Bindings" Version="3.1.0" />
<PackageReference Include="IronPython" Version="3.4.1" />
<PackageReference Include="IronPython.StdLib" Version="3.4.1" />
<PackageReference Include="KNX.net" Version="1.1.10" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.2" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="6.0.11" />
<PackageReference Include="MIG" Version="1.2.17" />
<PackageReference Include="MIG" Version="1.2.18" />
<PackageReference Include="MIG.HomeAutomation" Version="1.2.21" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="SerialPortStream" Version="2.4.1" />
<PackageReference Include="SerialPortStream" Version="2.4.2" />
<PackageReference Include="SharpZipLib" Version="1.4.2" />
<PackageReference Include="Angle" Version="3.3.0" />
<PackageReference Include="SolarCalculator" Version="3.3.0" />
<PackageReference Include="Jint" Version="3.0.0-beta-2051" />
<PackageReference Include="System.Device.Gpio" Version="3.0.0" />
<PackageReference Include="Jint" Version="3.1.0" />
<PackageReference Include="System.Device.Gpio" Version="3.1.0" />
<PackageReference Include="System.IO.Ports" Version="6.0.0" />
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.1" />
<PackageReference Include="System.Security.Cryptography.X509Certificates" Version="4.3.2" />
<PackageReference Include="CronExpressionDescriptor" Version="2.21.0" />
<PackageReference Include="LiteDB" Version="5.0.17" />
<PackageReference Include="CronExpressionDescriptor" Version="2.33.0" />
<PackageReference Include="LiteDB" Version="5.0.19" />
<PackageReference Include="NCrontab" Version="3.3.3" />
<PackageReference Include="SuperSocket.ClientEngine.Core" Version="0.10.0" />
<PackageReference Include="UnitsNet" Version="5.34.0" />

<PackageReference Include="MQTTnet" Version="4.3.1.873" />
<PackageReference Include="MQTTnet" Version="4.3.3.952" />
<PackageReference Include="SerialPortLib" Version="1.1.2" />
<PackageReference Include="MIG.Protocols" Version="1.2.9" />

Expand Down
2 changes: 2 additions & 0 deletions src/HomeGenie/Service/Constants/Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public const string InstallProgressMessage
= "InstallProgress.Message";
public const string InstallProgressUpdate
= "InstallProgress.Update";
public const string EventsDisable
= "Events.Disable";

// commonly used parameters
public const string StatusLevel
Expand Down
25 changes: 19 additions & 6 deletions src/HomeGenie/Service/HomeGenieService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,14 +472,21 @@ private void migService_InterfacePropertyChanged(object sender, InterfacePropert
{
LogError(ex);
}
// Prevent event pump from blocking on other worker tasks
// Route event to Master Control Program =)
if (masterControlProgram != null)
{
// Prevent event pump from blocking on other worker tasks
Task.Run(() =>
{
masterControlProgram.SignalPropertyChange(sender, module, args.EventData);
});
}
// check if event routing has been disabled for this module
var eventsDisable = Utility.ModuleParameterGet(module, Properties.EventsDisable);
if (eventsDisable != null && eventsDisable.Value == "1")
{
args.EventData.Disabled = true;
}
}
else
{
Expand Down Expand Up @@ -1267,13 +1274,16 @@ private void modules_RefreshInterface(MigInterface iface)
}
if (interfaceModules.Count > 0)
{
foreach (var migModule in interfaceModules)
for (var i = 0; i < interfaceModules.Count; i++)
{
Module module = systemModules.Find(o => o.Domain == migModule.Domain && o.Address == migModule.Address);
var migModule = interfaceModules[i];
Module module = systemModules.Find(o =>
o.Domain == migModule.Domain && o.Address == migModule.Address);
if (module == null)
{
// try restoring from garbage
module = modulesGarbage.Find(o => o.Domain == migModule.Domain && o.Address == migModule.Address);
module = modulesGarbage.Find(o =>
o.Domain == migModule.Domain && o.Address == migModule.Address);
if (module != null)
{
systemModules.Add(module);
Expand All @@ -1286,11 +1296,14 @@ private void modules_RefreshInterface(MigInterface iface)
systemModules.Add(module);
}
}

if (String.IsNullOrEmpty(module.Description))
{
module.Description = migModule.Description;
}
if (module.DeviceType == ModuleTypes.Generic && migModule.CustomData != null && migModule.CustomData.Type != null)

if (module.DeviceType == ModuleTypes.Generic && migModule.CustomData != null &&
migModule.CustomData.Type != null)
{
module.DeviceType = migModule.CustomData.Type;
}
Expand Down Expand Up @@ -1502,7 +1515,7 @@ private void SetupUpnp()
version = updateChecker.GetCurrentRelease().Version;
}
string modelNumber = version;
string standardDeviceType = "urn:schemas-glabs-it:device:HomeAutomationServer:1"; //"HomeAutomationServer";
string standardDeviceType = "HomeAutomationServer"; // "urn:schemas-glabs-it:device:HomeAutomationServer:1"
string uniqueDeviceName = systemConfiguration.HomeGenie.GUID;
if (String.IsNullOrEmpty(uniqueDeviceName))
{
Expand Down

0 comments on commit 237cc2a

Please sign in to comment.