Skip to content

Commit

Permalink
set appropriate context for length property
Browse files Browse the repository at this point in the history
  • Loading branch information
roe-dl committed Nov 6, 2022
1 parent 803f5e6 commit 491fefd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/user/dayboundarystats.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,13 @@ def _seqGenerator(genSpanFunc, timespan, *args, **option_dict):
@property
def length(self):
val = weewx.units.ValueTuple(self.timespan.stop-self.timespan.start, 'second', 'group_deltatime')
return weewx.units.ValueHelper(val, 'delta_time', self.formatter, self.converter)
if val[0]<=5400:
context = 'brief_delta'
elif val[0]<=86400:
context = 'short_delta'
else:
context = 'long_delta'
return weewx.units.ValueHelper(val, context, self.formatter, self.converter)


class DayboundaryStats(SearchList):
Expand Down

0 comments on commit 491fefd

Please sign in to comment.