fix(openhab): fix syntax error in event
value_template
#25140
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jinjava (the Jinja implementation openHAB uses) has an issue with using
is defined
on a filter (seeHubSpot/jinjava#1226). Using parentheses works around the issue, and is still compatible with Home Assistant's reference Python implementation.
Note that I plan on getting this fixed in Jinjava (I recently got
continue
support added (HubSpot/jinjava#1219) specifically to support this same value_template), but it might take a bit since I'm still fairly unfamiliar with Jinjava's internals, and they can take a while before they release a new version, so this workaround in Z2M is a much faster path to getting it working. Once Jinjava has been fixed and openHAB has a release with that fix, this workaround can be reverted.