custom-components / pyscript

Pyscript adds rich Python scripting to HASS
Apache License 2.0
874 stars 46 forks source link

Cron expression dont work #515

Closed Acidzero2020 closed 1 year ago

Acidzero2020 commented 1 year ago

I tried this cron expression and it does not work.

@time_trigger("cron(*/5 * * 8-1 *)")
[custom_components.pyscript.trigger] Invalid cron expression: <re.Match object; span=(0, 19), match='cron(*/5 * * 8-1 *)'>

If the month goes over 12, e.g. from October to January, it does not recognize that. If you enter the months one by one, it works without problems. @time_trigger("cron(*/5 * * 8,9,10,11,12,1,2,3 *)") or @time_trigger("cron(*/5 * * 8-12,1-3 *)") works too.

craigbarratt commented 1 year ago

pyscript uses croniter. I don't think it supports wrapping of field ranges, and I'm not aware of any implementations that do so.