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

Some typings are wrong #208

Closed Owlbertz closed 1 year ago

Owlbertz commented 1 year ago

After switching to the manual import I noticed that several typings are wrong:

triggers.ItemStateChangeTrigger('Test_Alarm', null, 'ON')

According to the IDE the second parameter must either be string or undefined - but both the docs and the example within the IDE show null being used.

triggers.SystemStartlevelTrigger('100')

According to the IDE the 100 needs to be a string, but both the docs and the example within the IDE show a number being used.

florian-h05 commented 1 year ago

In the first case, the docs are wrong. The parameter is optional, to skip it undefined should be used. In the second case, the type definitions and the docs are correct, but it may be possible that they are not released yet or you don't have downloaded them.