Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rules] Fix EventObject.itemName null is string instead of null #134

Merged

Conversation

florian-h05
Copy link
Contributor

Fixes an issue that I introduced in #125.

I added toString() to event.itemName, but this made null checks fail because even null is now a string. I double checked, and itemName is also string if I remove toString().

Signed-off-by: Florian Hotze florianh_dev@icloud.com

Fixes an issue that I introduced in openhab#125.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 added the bug Something isn't working label Jun 6, 2022
@florian-h05 florian-h05 added this to the 1.2.4 milestone Jun 6, 2022
@florian-h05 florian-h05 requested a review from digitaldan June 6, 2022 17:33
@florian-h05 florian-h05 changed the title [rules] Fix EventObject.itemName null is string instead of null [rules] Fix EventObject.itemName null is string instead of null Jun 6, 2022
@florian-h05
Copy link
Contributor Author

@digitaldan Can you review?

@florian-h05 florian-h05 changed the title [rules] Fix EventObject.itemName null is string instead of null [WIP] [rules] Fix EventObject.itemName null is string instead of null Jun 9, 2022
@digitaldan
Copy link
Contributor

👍

@digitaldan digitaldan merged commit 5376e87 into openhab:main Jun 9, 2022
@florian-h05 florian-h05 deleted the fix-event-itemname-null-is-string branch June 9, 2022 15:24
@florian-h05
Copy link
Contributor Author

@digitaldan
I know that I am too late, but I found out that the problem was not only my previous PR #125, but the problem is in the getTriggeredData function itself, therefore I am currently doing further investigation and I will refactor that method completely.

florian-h05 added a commit to florian-h05/openhab-js that referenced this pull request Jun 9, 2022
This allows `undefined` checks for the properties.
Fixes the issue described in openhab#134.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
digitaldan pushed a commit that referenced this pull request Jun 14, 2022
* [rules] Refactor EventObject to only have properties which have a value

This allows `undefined` checks for the properties.
Fixes the issue described in #134.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* [README] Update for EventObject changes

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* [rules] Move ruleConfig JSDoc to extra typedef

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* [README] Correct EventObject

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* Move CHANGELOG to extra file

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* Update CHANGELOG

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* Update rules/rules.js: Address review comment

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

Co-authored-by: Jonathan Gilbert <github.10.jgilbert@xoxy.net>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* [rules] Extract logic for adding values from HashMap to function

Addresses review comment.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* [rules] Remove `command` from event object

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* [rules] Event object holds no data when Core provided no event data

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* [rules] Mark `state` var of Event object as deprecated

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* [rules] Mark `receivedTrigger` of Event Object as deprecated

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

* [rules] Remove `status` from Event object JSDoc

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

Co-authored-by: Jonathan Gilbert <github.10.jgilbert@xoxy.net>
@florian-h05 florian-h05 changed the title [WIP] [rules] Fix EventObject.itemName null is string instead of null [rules] Fix EventObject.itemName null is string instead of null Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants