Skip to content

Commit

Permalink
- Fix GPIO pin program module naming
Browse files Browse the repository at this point in the history
- Fix notification dialog error if program uninstalled
- Updated UI
  • Loading branch information
genemars committed Jan 5, 2023
1 parent 5962e75 commit d7a0348
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
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.2190347d578b0732.js" type="module"></script>
<script src="runtime.b92e2ca178ebbf4a.js" type="module"></script><script src="polyfills.710b144f4805f4b0.js" type="module"></script><script src="main.b7f63b7bfc5d1f69.js" type="module"></script>

</body></html>

Large diffs are not rendered by default.

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": 1672875362094,
"timestamp": 1672923066300,
"index": "/app/index.html",
"assetGroups": [
{
Expand All @@ -15,7 +15,7 @@
"/app/613.16b9c52c0ae74833.js",
"/app/859.0f150be9c99a6b5a.js",
"/app/index.html",
"/app/main.2190347d578b0732.js",
"/app/main.b7f63b7bfc5d1f69.js",
"/app/manifest.webmanifest",
"/app/polyfills.710b144f4805f4b0.js",
"/app/runtime.b92e2ca178ebbf4a.js",
Expand Down Expand Up @@ -630,8 +630,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": "8c13f375ad99aee4a6609c9bb99ee147638aa945",
"/app/main.2190347d578b0732.js": "ecac267e18b5552619e8b0dff73c1644dd2405c5",
"/app/index.html": "66f738c2c1f693ca094ca11661e50472f06cb499",
"/app/main.b7f63b7bfc5d1f69.js": "95cd2eb88359089bc801f45abbc0e5eeefc74973",
"/app/manifest.webmanifest": "d47bb07a495e27ddf072f8702df373f79b4eb183",
"/app/polyfills.710b144f4805f4b0.js": "594a5ea1b9d3f9cbc4f363eca84eda2c8bb8a901",
"/app/runtime.b92e2ca178ebbf4a.js": "b50d841a4c50d466c34aab3267d3fb4afe87dede",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"repository":"homegenie","id":"homegenie-iot-net","version":"1.0.0","description":"GPIO, SPI, I2C examples based on .NET IoT libraries.\n\nhttps://learn.microsoft.com/en-us/dotnet/iot/intro","programs":[{"repository":"homegenie","packageId":"homegenie-iot-net","packageVersion":"1.0.0","hid":"700","id":"gpio-pin","required":false,"version":"1.0.0","checksum":"6F5D22E597CF667BD80769C4BB671D0F","installed":false}],"modules":null,"groups":[],"schedules":[]}
{"repository":"homegenie","id":"homegenie-iot-net","version":"1.0.0","description":"GPIO, SPI, I2C examples based on .NET IoT libraries.\n\nhttps://learn.microsoft.com/en-us/dotnet/iot/intro","programs":[{"repository":"homegenie","packageId":"homegenie-iot-net","packageVersion":"1.0.0","hid":"700","id":"gpio-pin","required":false,"version":"1.0.0","checksum":"795FF6FB11DE1010D18E755A4EF50A95","installed":false}],"modules":null,"groups":[],"schedules":[]}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var gpio_pins = new string[]{
"GPIO27 (pin 13)=27",
"GPIO22 (pin 15)=22",

"GPIO4 (pin 7)=7",
"GPIO4 (pin 7)=4",
"GPIO5 (pin 29)=5",
"GPIO6 (pin 31)=6",
"GPIO13 (pin 33)=13",
Expand Down Expand Up @@ -149,7 +149,7 @@ Program.GoBackground();
<Id>gpio-pin</Id>
<Version>1.0.0</Version>
<Required>false</Required>
<Checksum>6F5D22E597CF667BD80769C4BB671D0F</Checksum>
<Checksum>795FF6FB11DE1010D18E755A4EF50A95</Checksum>
</PackageInfo>
<Domain>HomeAutomation.HomeGenie.Automation</Domain>
<Address>700</Address>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"repository":"homegenie","id":"homegenie-iot-sharp","version":"1.0.0","description":"","programs":[{"repository":"homegenie","packageId":"homegenie-iot-sharp","packageVersion":"1.0.0","hid":"601","id":"dht-11-sensor","required":false,"version":"1.0.0","checksum":"3234723AF61E1E52FD1B134162E88093","installed":false},{"repository":"homegenie","packageId":"homegenie-iot-sharp","packageVersion":"1.0.0","hid":"602","id":"dht-22-sensor","required":false,"version":"1.0.0","checksum":"32EC4F6125839F3530864EB9A1D66F0E","installed":false},{"repository":"homegenie","packageId":"homegenie-iot-sharp","packageVersion":"1.0.0","hid":"600","id":"gpio-pin","required":false,"version":"1.0.0","checksum":"8C68A50941978859D4133B34B168CA7B","installed":false},{"repository":"homegenie","packageId":"homegenie-iot-sharp","packageVersion":"1.0.0","hid":"603","id":"grove-chainable-rgb-led","required":false,"version":"1.0.0","checksum":"68682FAA31D4BE1B5A6BD92C8117D644","installed":false}],"modules":null,"groups":[],"schedules":[]}
{"repository":"homegenie","id":"homegenie-iot-sharp","version":"1.0.0","description":"","programs":[{"repository":"homegenie","packageId":"homegenie-iot-sharp","packageVersion":"1.0.0","hid":"601","id":"dht-11-sensor","required":false,"version":"1.0.0","checksum":"3234723AF61E1E52FD1B134162E88093","installed":false},{"repository":"homegenie","packageId":"homegenie-iot-sharp","packageVersion":"1.0.0","hid":"602","id":"dht-22-sensor","required":false,"version":"1.0.0","checksum":"32EC4F6125839F3530864EB9A1D66F0E","installed":false},{"repository":"homegenie","packageId":"homegenie-iot-sharp","packageVersion":"1.0.0","hid":"600","id":"gpio-pin","required":false,"version":"1.0.0","checksum":"305F46ABBF0DC22F1DC4630DC48E65DA","installed":false},{"repository":"homegenie","packageId":"homegenie-iot-sharp","packageVersion":"1.0.0","hid":"603","id":"grove-chainable-rgb-led","required":false,"version":"1.0.0","checksum":"68682FAA31D4BE1B5A6BD92C8117D644","installed":false}],"modules":null,"groups":[],"schedules":[]}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ while (Program.IsEnabled)
Pause(pause);
}
</ScriptSource>
<ScriptErrors>[]</ScriptErrors>
<ScriptErrors />
<PackageInfo>
<Repository>homegenie</Repository>
<PackageId>homegenie-iot-sharp</PackageId>
Expand Down Expand Up @@ -294,8 +294,9 @@ var cfg = new PinConfiguration[1] {

// Add virtual module for this switch
const string moduleDomain = "RaspberryPi.GPIO";
Program.AddModule(moduleDomain, Program.Option("GPIO.Pin").Value, "Switch", "homegenie/generic/switch");
var mod = Modules.InDomain(moduleDomain).WithAddress(pinName).Get();
string moduleAddress = PinMapping.ToProcessor(pin).ToString().Substring(3); // get GPIO#
Program.AddModule(moduleDomain, moduleAddress, "Switch", "homegenie/generic/switch");
var mod = Modules.InDomain(moduleDomain).WithAddress(moduleAddress).Get();

// Allocate GPIO connection
GpioConnection connection = null;
Expand Down Expand Up @@ -375,15 +376,15 @@ if (pinMode == 1) { // Output

Program.GoBackground();
</ScriptSource>
<ScriptErrors />
<ScriptErrors>[]</ScriptErrors>
<PackageInfo>
<Repository>homegenie</Repository>
<PackageId>homegenie-iot-sharp</PackageId>
<PackageVersion>1.0.0</PackageVersion>
<Id>gpio-pin</Id>
<Version>1.0.0</Version>
<Required>false</Required>
<Checksum>8C68A50941978859D4133B34B168CA7B</Checksum>
<Checksum>305F46ABBF0DC22F1DC4630DC48E65DA</Checksum>
</PackageInfo>
<Domain>HomeAutomation.HomeGenie.Automation</Domain>
<Address>600</Address>
Expand Down
3 changes: 1 addition & 2 deletions src/HomeGenie/Automation/Scripting/ProgramHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ public ProgramHelper AddModule(string domain, string address, string type, strin
}
Utility.ModuleParameterSet(module, Properties.WidgetDisplayModule, widget);
}
homegenie.RaiseEvent(this, myProgramDomain, myProgramId.ToString(), "", Properties.ProgramEvent, $"MODULE_ADDED {domain}:{address}");
return this;
}

Expand Down Expand Up @@ -410,7 +409,6 @@ public ProgramHelper AddModules(
Utility.ModuleParameterSet(module, Properties.WidgetDisplayModule, widget);
homegenie.RaiseEvent(this, module.Domain, module.Address, "", Properties.WidgetDisplayModule, widget);
}
homegenie.RaiseEvent(this, myProgramDomain, myProgramId.ToString(), "", Properties.ProgramEvent, $"MODULE_ADDED {virtualModule.Domain}:{virtualModule.Address}");
}
return this;
}
Expand Down Expand Up @@ -881,6 +879,7 @@ private VirtualModule AddProgramModule(string domain, string address, string typ
Value = widget
});
homegenie.VirtualModules.Add(virtualModule);
homegenie.RaiseEvent(this, myProgramDomain, myProgramId.ToString(), "", Properties.ProgramEvent, $"MODULE_ADDED {virtualModule.Domain}:{virtualModule.Address}");
}
else
{
Expand Down

0 comments on commit d7a0348

Please sign in to comment.