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] Add semantics to the `Item` class #167

Closed florian-h05 closed 1 year ago

florian-h05 commented 1 year ago

@rkoshak Fixes #162.

Improvements to the Item class

Testing

I have tested those changes by editing an Item and then running the following script:

var sem = items.getItem('test_switch').semantics;

console.info(sem.equipmentType);
console.info(sem.locationType);
console.info(sem.pointType);
console.info(sem.propertyType);
console.info(sem.semanticType);
rkoshak commented 1 year ago

Looks good. This is going to simplify a bunch of my rules which use the semantic model.

florian-h05 commented 1 year ago

@rkoshak Can I merge from your side?

I think that @digitaldan is busy, and if you give approval I think that I can merge this.

rkoshak commented 1 year ago

Yes, it looks good to merge from my side.

But I'm not a reviewer on this repo so I can't do anything to officially mark off the review. If we need more than just this comment I'm afraid we'll have to wait for Dan.

florian-h05 commented 1 year ago

But I'm not a reviewer on this repo so I can't do anything to officially mark off the review. If we need more than just this comment I'm afraid we'll have to wait for Dan.

Somewhere it is written that a maintainer should not merge his/her own PRs, but instead one of the other maintainers should merge. Practically, when looking at some of the openHAB repos, some maintainers merge their own PRs.

This one has your review (yes, we can't mark it of, but it is written in the comments), so in my opinion we can merge, but I also have nothing against waiting for Dan.

Let's wait one day if he wants to comment something and merge then.