Skip to content

Commit

Permalink
fixed memory level program bug
Browse files Browse the repository at this point in the history
  • Loading branch information
genemars committed Sep 15, 2015
1 parent d70c191 commit f90a2f9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 42 deletions.
Binary file modified BaseFiles/Common/homegenie_factory_config.zip
Binary file not shown.
61 changes: 22 additions & 39 deletions BaseFiles/Common/programs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ Modules
Program.AddFeature("", "Dimmer", "HomeGenie.LevelMemory.SimulateOnly", "Simulate only", "checkbox");
Program.Run();
</ScriptCondition>
<ScriptSource>// We want to do further processing whenever a module changes
When.ModuleParameterChanged( (module, property) =&gt; {
<ScriptSource>When.ModuleParameterChanged( (module, property) =&gt; {
// stores the Status.MemoryLevel value for recalling last light dimmer level
// when switched on
if (module.HasFeature("HomeGenie.LevelMemory") &amp;&amp; module.IsOfDeviceType("Dimmer") &amp;&amp; property.Name == "Status.Level")
Expand All @@ -90,15 +89,15 @@ When.ModuleParameterChanged( (module, property) =&gt; {
if (level.DecimalValue != memory.DecimalValue &amp;&amp; memory.DecimalValue &gt; 0)
{
var newlevel = (int)(memory.DecimalValue * 100);
Program.Notify("Level Memory", module.Instance.Name + "&lt;br&gt;" + module.Instance.Address + " set to " + newlevel + "%");
if (module.HasFeature("HomeGenie.LevelMemory.SimulateOnly"))
{
module.Command("Control.Level.Adjust").Set(newlevel.ToString(System.Globalization.CultureInfo.InvariantCulture));
Program.RaiseEvent(module, "Status.Level", memory.Value, "Memory Level");
}
else
{
module.Level = newlevel;
}
Program.Notify("Level Memory", module.Instance.Name + "&lt;br&gt;" + module.Instance.Address + " set to " + newlevel + "%");
// returning false, prevent from routing event to other listeners
return false;
}
Expand All @@ -112,32 +111,16 @@ When.ModuleParameterChanged( (module, property) =&gt; {
// returning true, will route event to other listeners
return true;
});

Program.GoBackground();</ScriptSource>
<ScriptErrors>[]</ScriptErrors>
<Domain>HomeAutomation.HomeGenie.Automation</Domain>
<Address>16</Address>
<Name>Level Memory</Name>
<Description>Store and recall last dimmer level when device is switched on.</Description>
<Group>Lights</Group>
<Features>
<ProgramFeature>
<FieldType>checkbox</FieldType>
<ForDomains />
<ForTypes>Dimmer</ForTypes>
<Property>HomeGenie.LevelMemory</Property>
<Description>Recall last light level when switched on</Description>
</ProgramFeature>
<ProgramFeature>
<FieldType>checkbox</FieldType>
<ForDomains />
<ForTypes>Dimmer</ForTypes>
<Property>HomeGenie.LevelMemory.SimulateOnly</Property>
<Description>Simulate only</Description>
</ProgramFeature>
</Features>
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:48.770096Z</TriggerTime>
<Features />
<ActivationTime>2015-09-15T07:38:50.209948Z</ActivationTime>
<TriggerTime xsi:nil="true" />
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -257,7 +240,7 @@ For instructions see: http://developers.meethue.com/gettingstarted.html .</Descr
<Group>Devices and Things</Group>
<Features />
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:49.291944Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:10.526933Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -430,7 +413,7 @@ To activate this widget specify a valid user &lt;strong&gt;Key&lt;/strong&gt; th
<Group>Weather and Enviroment</Group>
<Features />
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:49.781058Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:11.027242Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -502,7 +485,7 @@ while (Program.IsEnabled)
</ProgramFeature>
</Features>
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:50.27894Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:11.526307Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -1103,7 +1086,7 @@ Program.GoBackground();</ScriptSource>
</ProgramFeature>
</Features>
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:50.77195Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:12.022618Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -1150,7 +1133,7 @@ Program.GoBackground();</ScriptSource>
</ProgramFeature>
</Features>
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:51.273885Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:12.530343Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -1424,7 +1407,7 @@ while (Program.IsEnabled)
</ProgramFeature>
</Features>
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:51.783521Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:13.032577Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -1521,7 +1504,7 @@ Program.GoBackground();</ScriptSource>
<Group>Z-Wave</Group>
<Features />
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:52.275249Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:13.524546Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -1575,8 +1558,8 @@ Program.GoBackground();</ScriptSource>
<Description>Automatic turn off delay (seconds)</Description>
</ProgramFeature>
</Features>
<ActivationTime>2015-09-14T08:50:58.230689Z</ActivationTime>
<TriggerTime xsi:nil="true" />
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-15T07:38:14.025123Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -1685,7 +1668,7 @@ Program.Run();
<Group>Messaging and Social</Group>
<Features />
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:53.288283Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:14.538464Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -2023,7 +2006,7 @@ Currently limited to one client channel.</Description>
</ProgramFeature>
</Features>
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:54.289747Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:15.540891Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -2121,7 +2104,7 @@ energy consumption.</Description>
<Group>Energy Management</Group>
<Features />
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:54.792122Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:16.057001Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -2270,7 +2253,7 @@ It requires that a manufacturer specific get has been issued on the node.</Descr
<Group>Z-Wave</Group>
<Features />
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:55.291733Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:16.541482Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -2517,7 +2500,7 @@ while (Program.IsEnabled)
</ProgramFeature>
</Features>
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:55.798102Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:17.041572Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -7811,7 +7794,7 @@ while (Program.IsEnabled)
</ProgramFeature>
</Features>
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:56.803598Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:18.053073Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down Expand Up @@ -8524,7 +8507,7 @@ Also it lets you dim last addressed module using Up/Down button which can be def
</ProgramFeature>
</Features>
<ActivationTime xsi:nil="true" />
<TriggerTime>2015-09-14T08:48:57.291321Z</TriggerTime>
<TriggerTime>2015-09-15T07:38:18.540701Z</TriggerTime>
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
Expand Down
Binary file modified BaseFiles/Common/programs/16.dll
Binary file not shown.
6 changes: 3 additions & 3 deletions HomeGenie_Linux/Packager/DEBIAN/md5sums
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ f85bd266c0d92a420ea12d5835156db8 usr/local/bin/homegenie/programs/7.dll
3fe281853346eb3a9ea008d37def1cd2 usr/local/bin/homegenie/programs/35.dll
2ac6b7a230154313232d1a8be051ce33 usr/local/bin/homegenie/programs/6.dll
f44705a2e7251541db32e4761cf6bae6 usr/local/bin/homegenie/programs/41.dll
55a99b504b3f1b0caa63b4931f493181 usr/local/bin/homegenie/programs/16.dll
8efb9babdfbfb500e59f0cc1c10d372c usr/local/bin/homegenie/programs/16.dll
6e911e0a393f7d7d6f2de035fa4f883b usr/local/bin/homegenie/Microsoft.Scripting.Metadata.dll
25e0bee9adfcd454f971c9b2ba6b6233 usr/local/bin/homegenie/HomeGenie.exe.mdb
09840f0bf937dcb3a448f1fb811595f1 usr/local/bin/homegenie/NetClientLib.dll.mdb
Expand All @@ -128,7 +128,7 @@ b367f1a0f7ba435a0c92f591f4ae0070 usr/local/bin/homegenie/Raspberry.IO.Component
2074c256e8b7a372e28490a436a8e04d usr/local/bin/homegenie/NLog.dll
dc2cba46f40f751f6e9e3fc72419de8f usr/local/bin/homegenie/HISTORY.TXT
3435a8ca2eb89ec7fc13a463590121c0 usr/local/bin/homegenie/README.TXT
6cfc95f2f2324513d021cc7c72d45f82 usr/local/bin/homegenie/programs.xml
e9d01dfc0c4218df9a2381967246c934 usr/local/bin/homegenie/programs.xml
31f6a40a74ca338743c99a13fbb093c2 usr/local/bin/homegenie/modules.xml
a19a8070a77444aafa96d3fbe033c42e usr/local/bin/homegenie/IronRuby.Libraries.dll
75bc82884f5bd1ab9c0a53ca0522e255 usr/local/bin/homegenie/Raspberry.IO.Interop.dll
Expand Down Expand Up @@ -1670,7 +1670,7 @@ e83a7949cb9a034b84156035d512c30c usr/local/bin/homegenie/NetClientLib.dll
272aa48b0bfd90305c6c27b4f4538566 usr/local/bin/homegenie/scheduler.xml
efc412d6344dca9073af5c2472728643 usr/local/bin/homegenie/groups.xml
61b0c6d8eb2c756355d52df2ef6170c6 usr/local/bin/homegenie/Microsoft.Scripting.dll
4e810e6b43aec44de82b1bd7bda3745c usr/local/bin/homegenie/homegenie_factory_config.zip
1440170b7749bbf78dafdf8c2faec0b2 usr/local/bin/homegenie/homegenie_factory_config.zip
acbb8de3a6a8f53d69957e2607097992 usr/local/bin/homegenie/DEVELOPERS.TXT
ae7bbf0f4b96d2a0effd97d69befb47e usr/local/bin/homegenie/CommonMark.dll
93675a8ef36065d0c64fe1bf4fb79902 usr/local/bin/homegenie/IronRuby.Libraries.Yaml.dll
Expand Down

0 comments on commit f90a2f9

Please sign in to comment.