Extending the Jinja to support odd and even filters

Tying to test if a number is odd or even. Hoping to use Jinja even() or odd().

unless there is a better way to determine this…

So I think it’s just an added filter needed. very similiar to this one : https://github.com/home-assistant/home-assistant/pull/5765

@CCOSTAN: How about (choreday | int % 2 == 0) for even and (choreday | int % 2 == 1) for odd?

I ended up using this:

https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/Speech/responsibilities.yaml#L24

Let’s just say, the kids weren’t that impressed. :slight_smile:

1 Like