-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
reset_every filter does not consider start of [day|week|month] #290
Comments
Uhm. This is a bit trickier that what I thought: the duration specified is internally converted to milliseconds. Later in the code, I don't really know if you wrote 1w or 7d or 168h.
I think the most intuitive behaviour is to use a specific parsing algorithm for this use case where the unit is kept, decimals are not allowed(i.e you can't do 1.5 weeks)
Do you see any corner case with this approach? |
I would agree no decimals, if you reset every 1.5 days, what is your start day? Which days get cut in half? Too much ambiguity. Every month resets on the 1st of each month (is that possible? I know in the yaml if you specify 1M, it really translates to 30 days, not exactly a month depending on which month we're in. If you start it on Jan 1st, it'll be off all year since Jan is 31 days. And after 12 months (365 days) you're off by 5 days.) Every week restarts on each Monday in my world. But I know there are a lot of Sunday fanatics as well (I don't think HA has a "first day of week" setting. At least I couldn't find one just now. You may be able to pull that out of the OS? (Though not sure if that's exposed)). So the every week one could be an issue here and there depending on localization. |
HA does allow changing the first day of the week. To do it, click on your name on the left side bar. This card uses that to configure what "current_week" means :) Resetting on the 1st is indeed possible, I'll need to "remember" the unit used and work with the actual calendar dates instead of bare milliseconds. I think it will work |
Describe the bug
When using a filter and using the
reset_every
setting, it resets everything based on current dayyaml
The text was updated successfully, but these errors were encountered: