Skip to content

Commit

Permalink
removed aggregate_interval option from gauges.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daveiano committed Jun 25, 2023
1 parent 2b5a9fc commit 7e4a050
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 49 deletions.
9 changes: 0 additions & 9 deletions bin/user/weewx_wdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1795,15 +1795,6 @@ def get_gauge_diagram_prop(self, obs, prop, context):

value = search_up(diagrams_config, prop, None)

# For week, month, year and alltime use the actual timespan in seconds.
if (prop == "aggregate_interval" and value is None):
if context == "week":
return 3600 * 24 * 7
if context == "month":
return 3600 * 24 * 30
if context == "year":
return 3600 * 24 * 365

return value

def get_windrose_data(self, start_ts, end_ts, context):
Expand Down
14 changes: 2 additions & 12 deletions skins/weewx-wdc/includes/gauge-tile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,12 @@
var $series_name = {
#if $context == 'day' and not $daily_archive
current: "$getattr($current, $partial_obs_key).nolabel('%.2f').replace(',','.')",
#else if $context == 'day' and $daily_archive
current: "$getattr($day, $partial_obs_key).avg.nolabel('%.2f').replace(',','.')",
#else
current: "$getattr($gauge_obs_binding, 'avg').nolabel('%.2f').replace(',','.')",
#end if

#if $context == 'day' and $daily_archive
min: "$getattr($day, $partial_obs_key).min.nolabel('%.2f').replace(',','.')",
max: "$getattr($day, $partial_obs_key).max.nolabel('%.2f').replace(',','.')",
#else if $context == 'day' and not $daily_archive
min: "$getattr($span(time_delta=$int($get_gauge_diagram_prop($partial_obs, 'aggregate_interval', $context))), $partial_obs_key).min.nolabel('%.2f').replace(',','.')",
max: "$getattr($span(time_delta=$int($get_gauge_diagram_prop($partial_obs, 'aggregate_interval', $context))), $partial_obs_key).max.nolabel('%.2f').replace(',','.')",
#else
min: "$getattr($gauge_obs_binding, 'min').nolabel('%.2f').replace(',','.')",
max: "$getattr($gauge_obs_binding, 'max').nolabel('%.2f').replace(',','.')",
#end if
min: "$getattr($gauge_obs_binding, 'min').nolabel('%.2f').replace(',','.')",
max: "$getattr($gauge_obs_binding, 'max').nolabel('%.2f').replace(',','.')",
obs: '$obs.label[$partial_obs]',
unit: "$get_unit_label($get_unit_for_obs($partial_obs, $partial_obs_key, $context))",
rounding: $get_rounding($partial_obs, $partial_obs_key),
Expand Down
2 changes: 0 additions & 2 deletions skins/weewx-wdc/skin.conf
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ SKIN_VERSION = 3.2.0
mode = normal
color_scheme = interpolateRdBu
invert_color_scheme = 1
[[[day]]]
aggregate_interval = 21600 # 6 hours

# ONLY enable these if you have weewx-xaggs installed!
#[[stat_tiles_xaggs]]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<g class="legend" transform="translate(272.49999618530273, 0)"><g transform="translate(0, 0)"><rect width="160" height="19" x="0" y="0" fill="transparent"></rect><rect x="144" y="1.5" width="14" data-testid="legend-rect-outTemp" height="14" style="pointer-events: none;" fill="#8B0000"></rect><text x="134" y="7.5" style="fill: rgb(139, 0, 0); dominant-baseline: central; pointer-events: none; font-size: 11px;" text-anchor="end">Outside Temperature Avg.</text></g><g transform="translate(0, 21)"><rect width="160" height="19" x="0" y="0" fill="transparent"></rect><rect x="144" y="1.5" width="14" data-testid="legend-rect-dewpoint" height="14" style="pointer-events: none;" fill="#5F9EA0"></rect><text x="134" y="7.5" style="fill: rgb(95, 158, 160); dominant-baseline: central; pointer-events: none; font-size: 11px;" text-anchor="end">Dew Point Avg.</text></g></g>
<g class="legend" transform="translate(272.5000057220459, 0)"><g transform="translate(0, 0)"><rect width="160" height="19" x="0" y="0" fill="transparent"></rect><rect x="144" y="1.5" width="14" data-testid="legend-rect-outTemp" height="14" style="pointer-events: none;" fill="#8B0000"></rect><text x="134" y="7.5" style="fill: rgb(139, 0, 0); dominant-baseline: central; pointer-events: none; font-size: 11px;" text-anchor="end">Outside Temperature Avg.</text></g><g transform="translate(0, 21)"><rect width="160" height="19" x="0" y="0" fill="transparent"></rect><rect x="144" y="1.5" width="14" data-testid="legend-rect-dewpoint" height="14" style="pointer-events: none;" fill="#5F9EA0"></rect><text x="134" y="7.5" style="fill: rgb(95, 158, 160); dominant-baseline: central; pointer-events: none; font-size: 11px;" text-anchor="end">Dew Point Avg.</text></g></g>
8 changes: 4 additions & 4 deletions test/e2e-tests/diagrams/gauges.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ test.describe("Gauges", () => {
{
url: "artifacts-custom-weewx-html/public_html/index.html",
current: "20.9°C",
min: "11.5°C",
max: "21.4°C",
min: "11.4°C",
max: "21.5°C",
title: "Outside Temperature",
},
{
Expand All @@ -22,8 +22,8 @@ test.describe("Gauges", () => {
{
url: "artifacts-custom-weewx-html/public_html/index.html",
current: "177°",
min: "146°",
max: "177°",
min: "130°",
max: "183°",
title: "Wind Direction",
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
var outTempGaugeSeries0 = {
current: "20.94",

min: "11.51",
max: "21.37",
min: "11.39",
max: "21.50",
obs: 'Outside Temperature',
unit: "&#176;C",
rounding: 1,
properties: {'tick_number': '7', 'arc': '1.2', 'offset': '20', 'mode': 'normal', 'color_scheme': 'interpolateRdBu', 'invert_color_scheme': '1', 'aggregate_interval': '21600', 'min': '-20', 'max': '40'},
properties: {'tick_number': '7', 'arc': '1.2', 'offset': '20', 'mode': 'normal', 'color_scheme': 'interpolateRdBu', 'invert_color_scheme': '1', 'min': '-20', 'max': '40'},
label: "Outside Temperature"
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
var outTempGaugeSeries0 = {
current: "20.94",

min: "11.51",
max: "21.37",
min: "11.39",
max: "21.50",
obs: 'Outside Temperature',
unit: "&#176;C",
rounding: 1,
properties: {'tick_number': '7', 'arc': '1.2', 'offset': '20', 'mode': 'normal', 'color_scheme': 'interpolateRdBu', 'invert_color_scheme': '1', 'aggregate_interval': '21600', 'min': '-20', 'max': '40'},
properties: {'tick_number': '7', 'arc': '1.2', 'offset': '20', 'mode': 'normal', 'color_scheme': 'interpolateRdBu', 'invert_color_scheme': '1', 'min': '-20', 'max': '40'},
label: "Outside Temperature"
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
var outTempGaugeSeries0 = {
current: "18.20",

min: "8.11",
max: "37.39",
min: "8.11",
max: "37.39",
obs: 'Outside Temperature',
unit: "&#176;C",
rounding: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
var outTempGaugeSeries0 = {
current: "18.20",

min: "8.11",
max: "37.39",
min: "8.11",
max: "37.39",
obs: 'Outside Temperature',
unit: "&#176;C",
rounding: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
var windDirGaugeSeries3 = {
current: "177.34",

min: "146.45",
max: "177.34",
min: "130.00",
max: "183.00",
obs: 'Wind Direction',
unit: "&#176;",
rounding: 0,
properties: {'tick_number': '7', 'arc': '2', 'offset': '20', 'mode': 'normal', 'color_scheme': 'interpolateRdBu', 'invert_color_scheme': '1', 'aggregate_interval': '21600', 'min': '0', 'max': '360'},
properties: {'tick_number': '7', 'arc': '2', 'offset': '20', 'mode': 'normal', 'color_scheme': 'interpolateRdBu', 'invert_color_scheme': '1', 'min': '0', 'max': '360'},
label: "Wind Direction"
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
var windDirGaugeSeries3 = {
current: "177.34",

min: "146.45",
max: "177.34",
min: "130.00",
max: "183.00",
obs: 'Wind Direction',
unit: "&#176;",
rounding: 0,
properties: {'tick_number': '7', 'arc': '2', 'offset': '20', 'mode': 'normal', 'color_scheme': 'interpolateRdBu', 'invert_color_scheme': '1', 'aggregate_interval': '21600', 'min': '0', 'max': '360'},
properties: {'tick_number': '7', 'arc': '2', 'offset': '20', 'mode': 'normal', 'color_scheme': 'interpolateRdBu', 'invert_color_scheme': '1', 'min': '0', 'max': '360'},
label: "Wind Direction"
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
var windDirGaugeSeries3 = {
current: "198.48",

min: "14.00",
max: "359.00",
min: "14.00",
max: "359.00",
obs: 'Wind Direction',
unit: "&#176;",
rounding: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
var windDirGaugeSeries3 = {
current: "198.48",

min: "14.00",
max: "359.00",
min: "14.00",
max: "359.00",
obs: 'Wind Direction',
unit: "&#176;",
rounding: 0,
Expand Down
1 change: 0 additions & 1 deletion test/test_install_report/src/skin-custom.conf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ SKIN_VERSION = 2.2.1
color_scheme = interpolateRdBu
invert_color_scheme = 1
[[[day]]]
aggregate_interval = 21600 # 6 hours
[[[[outTemp]]]]
min = -20
max = 40
Expand Down

0 comments on commit 7e4a050

Please sign in to comment.