-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Scott Rushworth <[email protected]>
- Loading branch information
Scott Rushworth
committed
May 25, 2019
1 parent
f80dedc
commit b3d77c9
Showing
12 changed files
with
267 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Functions for creating Conditions | ||
* | ||
* Copyright (c) 2019 Contributors to the openHAB Scripters project | ||
* | ||
* @author Helmut Lehmeyer - initial contribution | ||
*/ | ||
'use strict'; | ||
|
||
scriptExtension.importPreset("RuleSupport"); | ||
|
||
// Get Triggers and Conditions module output | ||
// http://localhost:8080/rest/module-types | ||
|
||
// Examles: | ||
// see: org.eclipse.smarthome.automation.sample.extension.java.internal.WelcomeHomeRulesProvider.createLightsRule() | ||
|
||
if(ModuleBuilder == undefined)var ModuleBuilder = Java.type("org.eclipse.smarthome.automation.core.util.ModuleBuilder"); | ||
|
||
// ### stateCondition ### | ||
var ItemStateCondition = function(itemName, state, condName){ | ||
return ModuleBuilder.createCondition().withId(getTrName(condName)).withTypeUID("core.ItemStateCondition").withConfiguration( new Configuration({ | ||
"itemName": itemName, | ||
"operator": "=", | ||
"state": state | ||
})).build(); | ||
} | ||
var stateCondition = ItemStateCondition; | ||
|
||
// ### GenericCompareCondition ### | ||
var GenericCompareCondition = function(itemName, state, operator, condName){ | ||
return ModuleBuilder.createCondition().withId(getTrName(condName)).withTypeUID("core.GenericCompareCondition").withConfiguration( new Configuration({ | ||
"itemName": itemName, | ||
"operator": operator,// matches, ==, <, >, =<, => | ||
"state": state | ||
})).build(); | ||
} | ||
//compareCondition("itemName", OFF, "==", "condNameOfCompareCondition") | ||
var compareCondition = GenericCompareCondition; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
162 changes: 0 additions & 162 deletions
162
Core/automation/lib/javascript/core/triggersAndConditions.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.