QNimbus / node-red-contrib-openhab-v2

MIT License
9 stars 3 forks source link

What's the differences of "ItemStateChanged" and "ItemState"? #9

Closed kevinshane closed 5 years ago

kevinshane commented 5 years ago

Hey guys, I can see the ItemStateChanged has oldValue rather than the ItemState event payload. But what else differences between these two? Also, both types will output the payload twice which makes no sense if we can decide which event type in drop down menu. Can I make the ItemState output only once with only the item state? and make the ItemStateChanged also ouput once but with more extra payload such as oldValue? Thanks!

QNimbus commented 5 years ago

I'm not sure I understand your question/issue:

See video capture of the 'IN' node in a test setup

When I select either 'ItemStateChanged' or 'ItemState' event, I only receive those events exactly once as they happen. Note that I have 'output at startup' deselected. I did, however just notice a bug where if I select 'output at startup', all events get send all the time (which is not supposed to happen)

So I will leave this issue open so I can work on that particular bug - was that what you meant to report?

kevinshane commented 5 years ago

Yes Sir you are right, I did ticked on Start output and the issue happen. (send payload twice) After I tick off the Start output everything become normal now. Could you please fix that? Thank you so much!

QNimbus commented 5 years ago

Fix is already pushed to GitHub; should propagate to npmjs in a short while. Please let me know if this fixes your issue! Thanks for reporting!

Fixed in commit bf12d26f75e328e4aaa479745572cf3e5cf4ad73

kevinshane commented 5 years ago

really awesome job! Thank you sir! We can close the issue now.