openhab / openhab-js

openHAB JavaScript Library for JavaScript Scripting Automation
https://www.openhab.org/addons/automation/jsscripting/
Eclipse Public License 2.0
38 stars 31 forks source link

[items & things] Add `toString` overrides & Clean-Ups #198

Closed florian-h05 closed 1 year ago

florian-h05 commented 1 year ago

Reference #197 (fixes the JS library side).

To Dos

florian-h05 commented 1 year ago

@jpg0 Can I remove thing builder and channel builder here?

jpg0 commented 1 year ago

@jpg0 Can I remove thing builder and channel builder here?

Are they used? I don't mind whether they go or stay, I suppose it depends on the purpose of the library. I used them to define and register things and channels in scripts (and then refer to them from other scripts). I did this to move all my configuration into JS, and then could reference everything via JS imports instead of name strings.

However if this library is limited to rules based on existing definitions, then this functionality should be removed.

Maybe @digitaldan has an opinion?

digitaldan commented 1 year ago

Maybe @digitaldan has an opinion?

I would error on the side of simplicity. Since it's undocumented and probably unused by most, i think removing it makes sense.

florian-h05 commented 1 year ago

So we agree that we remove that?

Can one of you please review here (although the changes apart from the removal are minimal).

florian-h05 commented 1 year ago

@jpg0 @digitaldan Can you please review here? You can ignore the *.d.ts files, these type definitions are auto generated and only required for auto-completion, not for the library's functionality itself. If you approve, please let me merge - I have to adjust the commit message.