Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Automation] ConfigDescription for ScriptedTrigger is missing #962

Closed
philippwaller opened this issue Aug 10, 2019 · 0 comments
Closed

[Automation] ConfigDescription for ScriptedTrigger is missing #962

philippwaller opened this issue Aug 10, 2019 · 0 comments
Labels
automation bug An unexpected problem or unintended behavior of the Core

Comments

@philippwaller
Copy link
Contributor

philippwaller commented Aug 10, 2019

According to the implementation of the ScriptedAutomationManager, a ScriptedTrigger can be created in a similar way as a ScriptedCondition or ScriptedAction:

// GROOVY 2.5.7 
// 1. Step: create private handler
// 2. Step: register handler and cache privId
// 3. Step: pass the privId to the module configuration

// 1. create private handler
SimpleTriggerHandler handler = new SimpleTriggerHandler() {
    void setRuleEngineCallback(Trigger module, SimpleTriggerHandlerCallback ruleCallback) {
        super.setRuleEngineCallback(module, ruleCallback)
        // custom handler entry point 
     }
}

// 2. register private handler
String privId = automationManager.addPrivateTriggerHandler(handler)

// 3. create module
TriggerBuilder.create()
    .withId("custom_trigger")
    .withTypeUID("jsr223.ScriptedTrigger")
    .withConfiguration(new Configuration(['privId': privId]))
    .build()

However, the PrivateScriptesTypes definition for jsr223.ScriptedTrigger does not mentioned the required input parameter privId. But since the shown procedure works perfectly, I guess the configDescription is just missing.

@cweitkamp cweitkamp added automation bug An unexpected problem or unintended behavior of the Core labels Aug 13, 2019
Rosi2143 pushed a commit to Rosi2143/openhab-core that referenced this issue Dec 26, 2020
That was kinda annoying for me.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
automation bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

No branches or pull requests

2 participants