jpg0 / ohj

Openhab Javascript Library
Eclipse Public License 2.0
6 stars 2 forks source link

Accept single trigger in JSRule #12

Closed simonihmig closed 3 years ago

simonihmig commented 3 years ago

The code block example suggests passing a single trigger instance is possible (see https://github.com/jpg0/ohj/blob/master/rules.js#L91), but it had to be an array actually. This change now accepts both. I believe that's reasonable, as many rules will have just a single trigger (e.g. cron), so having to wrap in an array explicitly might be annoying.

simonihmig commented 3 years ago

Hm, seems my IDE doesn't like the trailing spaces. Which makes the diff a bit confusing. Hope you don't mind?

jpg0 commented 3 years ago

No worries about the spaces and thanks!

simonihmig commented 3 years ago

@jpg0 seems this change was lost by your commit here: https://github.com/jpg0/ohj/commit/791e3c82eaef124bacb8d6d3fcd31431a3177dae 😬

jpg0 commented 3 years ago

Ah sorry. Things are a bit of a mess atm because I planned to upgrade everything to OH3, then had to abandon upgrading due to https://github.com/openhab/openhab-core/issues/2002

I'll fix this now

jpg0 commented 3 years ago

https://github.com/jpg0/ohj/commit/58e0f1555bccc099b805fd5766c94f0a8ea1ac22