openhab-scripters / openhab-helper-libraries

Scripts and modules for use with openHAB
Eclipse Public License 1.0
88 stars 70 forks source link

[triggers] Cron expressions are not valid trigger UIDs #189

Closed CrazyIvan359 closed 5 years ago

CrazyIvan359 commented 5 years ago

Describe the bug Cron triggers specified as only the expression cause errors using the when decorator.

To Reproduce Use a cron trigger with the when decorator without the preface "Time cron"

@rule("testrule", "testrule")
@when("*/5 * * * * ?")

results in:

10:17:07.289 [INFO ] [smarthome.event.RuleStatusInfoEvent  ] -
  a2f3e9b4-3e05-4f4e-99ee-dbc8a92ee4ef updated: UNINITIALIZED (INVALID_RULE):
  Validation of rule a2f3e9b4-3e05-4f4e-99ee-dbc8a92ee4ef has failed!
  Invalid module uid: Time-cron-*/5 * * * * ?-b7d2540fae1d11e9aeb3d9912b9c889b.
  It is null or not fit to the pattern: [A-Za-z0-9_-]*
5iver commented 5 years ago

This usage is not documented anywhere (shouldn't be) and is only still around for backwards compatibility. However, I had reworked the validation and trigger naming a couple weeks ago, so this should be fixed. I'll test to be sure.

5iver commented 5 years ago

Closed in #209