mirror of
https://github.com/weewx/weewx.git
synced 2026-05-18 23:05:30 -04:00
@@ -28,6 +28,9 @@ The utility and documentation have been changed to use `cur_in_temp` (one
|
||||
'`r`'), making all types consistent. Fixes [Issue
|
||||
#1006](https://github.com/weewx/weewx/issues/1006).
|
||||
|
||||
Fix a problem caused by an assumption that delta times are always in seconds.
|
||||
Fixes issue [Issue #1009](https://github.com/weewx/weewx/issues/1009).
|
||||
|
||||
|
||||
### 5.1.0 07/04/2024
|
||||
|
||||
|
||||
@@ -415,17 +415,17 @@ class AlmanacBinder:
|
||||
|
||||
def visible_change(self, days_ago=1):
|
||||
"""Change in visibility of the heavenly body compared to 'days_ago'."""
|
||||
# Visibility for today:
|
||||
# Visibility for today, as a ValueTuple
|
||||
today_visible = self.visible
|
||||
# The time to compare to
|
||||
then_time = self.almanac.time_ts - days_ago * 86400
|
||||
# Get a new almanac, set up for the time back then
|
||||
then_almanac = self.almanac(almanac_time=then_time)
|
||||
# Find the visibility back then
|
||||
# Find the visibility back then as a ValueTuple
|
||||
then_visible = getattr(then_almanac, self.heavenly_body).visible
|
||||
# Take the difference
|
||||
diff = today_visible.raw - then_visible.raw
|
||||
return weewx.units.ValueHelper(ValueTuple(diff, "second", "group_deltatime"),
|
||||
# Take the difference, which will also be a ValueTuple
|
||||
diff_vt = today_visible.value_t - then_visible.value_t
|
||||
return weewx.units.ValueHelper(diff_vt,
|
||||
context="hour",
|
||||
formatter=self.almanac.formatter,
|
||||
converter=self.almanac.converter)
|
||||
|
||||
Reference in New Issue
Block a user