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

fix: Remove extraneous whitespace in template for binary attributes #24520

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented Oct 28, 2024

I assume Home Assistant strips the whitespace at some point before comparing it to payload_on/payload_off, but I haven't quite found where yet. I have confirmed Python preserves the whitespace when simply evaluating the Jinja.

For openHAB, it does not strip the whitespace, causing errors because it doesn't match the payload_on or payload_off values. At some point I'd like to bring openHAB inline with Home Assistant, but I need to do so carefully without breaking something unexpectedly (especially with non- Home Assistant MQTT integrations). In the meantime, this should fix the issue in openHAB, without causing issues for Home Assistant or any other software that follows Home Assistant's MQTT discovery process.

I assume Home Assistant strips the whitespace at some point before
comparing it to payload_on/payload_off, but I haven't quite found where yet.
I have confirmed Python preserves the whitespace when simply evaluating
the Jinja.

For openHAB, it does not strip the whitespace, causing errors because
it doesn't match the payload_on or payload_off values. At some point I'd
like to bring openHAB inline with Home Assistant, but I need to do so
carefully without breaking something unexpectedly (especially with non-
Home Assistant MQTT integrations). In the meantime, this should fix the
issue in openHAB, without causing issues for Home Assistant or any other
software that follows Home Assistant's MQTT discovery process.
@Koenkk Koenkk merged commit ab72606 into Koenkk:dev Oct 28, 2024
11 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Oct 28, 2024

Thanks!

@ccutrer ccutrer deleted the binary-attribute-whitespace branch October 28, 2024 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants