openhab-scripters / openhab-helper-libraries

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

Initial migration of Javascript libraries #124

Closed 5iver closed 5 years ago

5iver commented 5 years ago

Resolves #120.

Changes made to original JS libraries:

  1. Corrected paths for the new directory structure
  2. Changed helper.mainPath to automationPath + 'lib/javascript/core/'
  3. Changed the default logger to jsr223.javascript (I'd like to remove the jsr223, for Jython too, so this may be a good time to do it)
  4. Moved the README.md to Docs/Javascript/
  5. Renamed JSRule.js to rules.js
  6. Renamed helper.js to utils.js
  7. Split triggersAndConditions.js into triggers.js and conditions.js
  8. Renamed a couple example scripts
  9. Commented out imports in utils.js (helper.js) that are included in 'default' preset
  10. Misc cleanup

If you have helper libraries for more than one language, there will be more than one startup delay script. This may not be optimal, but doesn't hurt anything.

Signed-off-by: Scott Rushworth openhab@5iver.com

Confectrician commented 5 years ago

I would suggest to add issues for your listed suggestion points above.

We can than talk about or implemnt them in pieces.

lewie commented 5 years ago

@openhab-5iver, if you want, you can still use this formatting for the header:

@author Helmut Lehmeyer <helmut.lehmeyer@gmail.com> - initial contribution.

In "Changes made to original JS libraries:" All other points are perfect.

In "Suggestions": Unify what seems to you to make sense full! We want as much agreement as possible between the languages. to 3) No "ON/OFF" is not added as things! This was an older Version I think, where I mapped the OnOffType class.

5iver commented 5 years ago

@lewie, I'd sent you an invite to the maintains team, but I see you have not accepted it yet. It would be nice if you cod do a review/approval, but that wouldn't be possible until that is done. I'll go ahead an merge this, and we can clean things up in PRs. I did not include the email address in the header, since there would be cleanup needed if/when the address changed and we can be contacted through GH or the forum. If this is an issue for you, we can change it later or discuss in #131.

lewie commented 5 years ago

@openhab-5iver, great, thanks! The e-mail in the header also has disadvantages, let's omit it.