Skip to content

[feature] API compatibility with openhab-helper-libraries #1

@mbronk

Description

@mbronk

Is it planned for these libs to eventually become interface-compatible with the legacy OpenHAB Helper Libraries
Alternatively, provide a migration guide?

Why consider?

I don't have any current stats to back this up, but I believe the helper libs are/were pretty popular back in the day (esp. as they were available in multiple languages 🥇 and really well documented 📖 ).
I believe the repo might have been abandoned and the original libraries available at: https://github.com/openhab-scripters/openhab-helper-libraries may no longer work as-is with OH >= 3.x, but there are forks, such as these:

... that just work ™ - to this day (OH 5.0 snapshot, legacy Jython-based binding).

I see these libs adopt some of similar syntax, like @rule annotations, so it would be awesome 🚀 to make the migration as painless as possible.

  • Note: I'm not at all proposing to overencumber the libraries with needless legacy.
    Just making a practical observation that since there's something out there (with non-zero install base), it may make some sense to consider leveling with those APIs where it makes sense, to make it easier for people to jump ship to the new coolness 😉.
    Same goes with directory organization etc.

Alternative ideas / constraints

  1. IMHO it only makes sense to support python 3.x going forward, which means even if these libs were 100% API-compatible with the openhab-helper-libraries (legacy), one would likely need to at least run their scripts through 2to3 for syntax compatibility.
  2. The new libraries get to use much more modern stuff with some legacy APIs likely not being needed at all. A "breaking changes" kind of note for these would be helpful though (and while the implementation will surely differ, I'm not sure if the APIs need to vary too much).
  3. Alternatively, the org.openhab.automation.pythonscripting binding could allow choice of which helper libs to use (this cleanroom implementation vs. a legacy-compatible).

PS. @HolgerHees hats off to you for the great work you've done w/ both these libs and the OH binding. 👏 👏 👏
I haven't been able to run it on my production setup yet (too many legacy rules to rewrite), but it is looking very promising already when I was playing with it on a sandbox. Don't want to overpromise anything as I don't have much time for personal projects lately, but would happily help out in the limited capacity I can (at least testing & feedback, possibly some coding)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions