-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[mqtt.homeassistant] Fix jinja usage in availability templates #17400
[mqtt.homeassistant] Fix jinja usage in availability templates #17400
Conversation
Use the local Jinjava, instead of implicitly depending on the Jinja transformation service. Signed-off-by: Cody Cutrer <cody@cutrer.us>
Test fails. |
Yes, but I don't understand why. The Homie itests are failing that it's unable to load the ChannelTransformation class, but that class is in the org.openhab.core.thing bundle. How on earth would that bundle not be available?? |
Spend over an hour looking at this, but i also don;t understand why this is failing. Maybe @wborn can add anything as he knows way more about the itest's (no pressure ;-) ) |
I was able to get it to pass locally by importing private void doNothing(ChannelTransformation transform) {
System.out.println("Transform: " + transform.toString());
} Obviously that's not a proper solution, but it points to something about the Homie bundle not listing the ChannelTransformation class as a necessary import or something. I'm waaaay out of my Java depth with this, though. |
@wborn: have you had a chance to look at this? |
I think it's some Mockito bug. We could try upgrading Mockito and see if that helps. |
I tried, but ran into the same thing as you! mockito/mockito#2708 |
Signed-off-by: Cody Cutrer <cody@cutrer.us>
Given that it seems like a Mockito upgrade is some ways away, I've added my dummy method workaround to get this PR through. We can revisit removing it if/when Mockito gets upgraded in core. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, the dummy method is a small price to move forward. It is well documented so LGTM
…ab#17400) * [mqtt.homeassistant] Fix jinja usage in availability templates Use the local Jinjava, instead of implicitly depending on the Jinja transformation service. Signed-off-by: Cody Cutrer <cody@cutrer.us>
…ab#17400) * [mqtt.homeassistant] Fix jinja usage in availability templates Use the local Jinjava, instead of implicitly depending on the Jinja transformation service. Signed-off-by: Cody Cutrer <cody@cutrer.us>
Use the local Jinjava, instead of implicitly depending on the Jinja transformation service.
This was missed in the recent conversion to using Jinjava for transformations in "normal" channels.