How about a length property in TimespanBinder?

47 views
Skip to first unread message

Karen K

unread,
Nov 5, 2022, 3:35:42 AM11/5/22
to weewx-development
Months are not always of the same length. Days vary in length when daylight savings time starts or ends. How about a length property in TimespanBinder?

    @property
    def length(self):
        val = weewx.units.ValueTuple(self.timespan.stop-self.timespan.start, 'second', 'group_deltatime')
        return weewx.units.ValueHelper(val, self.context, self.formatter, self.converter)

Tom Keffer

unread,
Nov 5, 2022, 8:12:28 AM11/5/22
to Karen K, weewx-development
Good idea. Wouid you like to submit a PR?

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/e2899330-5750-4840-9211-c9e8a3b169bfn%40googlegroups.com.

Joel Bion

unread,
Nov 5, 2022, 8:17:01 AM11/5/22
to Tom Keffer, Karen K, weewx-development
I love the idea but can it be called something more specific to time? (Such as “duration”?)

Joel

Sent from my iPhone

On Nov 5, 2022, at 5:12 AM, Tom Keffer <tke...@gmail.com> wrote:



Karen K

unread,
Nov 6, 2022, 3:36:06 AM11/6/22
to weewx-development
jpb...@gmail.com schrieb am Samstag, 5. November 2022 um 13:17:01 UTC+1:
I love the idea but can it be called something more specific to time? (Such as “duration”?)

As there are no further comments I guess I will send the PR as shown in the first post. 

Karen K

unread,
Nov 6, 2022, 9:28:36 AM11/6/22
to weewx-development
Tom Keffer schrieb am Samstag, 5. November 2022 um 13:12:28 UTC+1:
Good idea. Wouid you like to submit a PR?


Reply all
Reply to author
Forward
0 new messages