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

Jinja2's round filter is overriden with one without rounding method #11458

Closed
Diaoul opened this issue Jan 4, 2018 · 5 comments
Closed

Jinja2's round filter is overriden with one without rounding method #11458

Diaoul opened this issue Jan 4, 2018 · 5 comments

Comments

@Diaoul
Copy link
Contributor

Diaoul commented Jan 4, 2018

Home Assistant release (hass --version):
0.60.0 (Docker)

Python release (python3 --version):
Docker

Component/platform:
template

Description of problem:
Home Assistant's round filter is shadowing Jinja2's without the method kwarg.
{{ (states.device_tracker.myphone.attributes.battery / 10.0) | round(method='ceil') }} doesn't work.

Expected:
Same as Jinja2's, i.e. rounding method is customizable. See http://jinja.pocoo.org/docs/2.10/templates/#round

@tschmidty69
Copy link
Contributor

Round is actually redefined as a new filter, so you are right it does not support the method keyword. I'll give it a poke although you could just add .5 to your value :-)

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@Diaoul
Copy link
Contributor Author

Diaoul commented Mar 30, 2018 via email

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@balloobbot
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants