Very Silly Question

jltnol
Posts: 1162
Joined: Tue Oct 15, 2013 11:11 pm

Very Silly Question

Post by jltnol »

Do all Timed Devices Week States roll over at 00:00 on Sunday, regardless of when the timer device was created? I'm guessing the answer is yes, but just want to make sure. :lol:
jltnol
Posts: 1162
Joined: Tue Oct 15, 2013 11:11 pm

Re: Very Silly Question

Post by jltnol »

So I guess to no ones surprise but me, the week for this device starts Monday morning at 00:00

I created a new Timed Device yesterday (Sunday), ran it for a short period of time and turned it off.

Today, Monday, if the week started on Sunday, I would expect to see the time from yesterday to be in the secondsThisWeek00 category, but because the week starts on Monday, they were rolled over into the secondsThisWeek01 category.

Just passing along info I'm guessing everyone already knows....
User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Very Silly Question

Post by durosity »

I love it when I see old topics picked up again like that!

Is that how you want it to work?
Computer says no.
kmarkley
Posts: 187
Joined: Tue Nov 15, 2016 8:04 pm

Re: Very Silly Question

Post by kmarkley »

jltnol wrote: Sun Jan 15, 2023 6:43 pm Do all Timed Devices Week States roll over at 00:00 on Sunday, regardless of when the timer device was created? I'm guessing the answer is yes, but just want to make sure. :lol:
The plugin just uses date.isocalendar() to determine when a new week starts. The ISO standard is for weeks to start on Monday:
https://docs.python.org/3/library/datet ... te-objects
jltnol
Posts: 1162
Joined: Tue Oct 15, 2013 11:11 pm

Re: Very Silly Question

Post by jltnol »

So I became aware of this a while ago, but just recently confirmed my suspicions. Totally understand how and why it works this way... but might be nice to be able to set the day you want the week to start on in the config.. or perhaps in the Device.

But also assume this would kind of be a massive undertaking to do... and just not really worth the effort.

Once I became aware of when the week starts, it was easy to get the info I needed in a way that made sense for me...
Post Reply

Return to “kmarkley's plugins”