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

Fix instance of Item checks don't work #290

Closed florian-h05 closed 10 months ago

florian-h05 commented 10 months ago

Fixes an issue, where the webpacked, globals injected time.toZDT(items.Item) did not work, because https://github.com/openhab/openhab-js/pull/283 did revert https://github.com/openhab/openhab-js/pull/273 and therefore constructor names are not kept.

This introduces a _isItem helper method, which checks both constructor name or unique properties (rawItem).