Skip to content

Commit

Permalink
Fixes [GH-37]
Browse files Browse the repository at this point in the history
  • Loading branch information
Daveiano committed Aug 2, 2022
1 parent 7142628 commit c1d83e9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/user/weewx_wdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,11 @@ def get_rounding(self, observation):
if observation == "ET" or observation == "rain":
return 2

if (
observation == "pressure" or observation == "barometer"
) and self.unit.unit_type.pressure == "inHg":
return 3

return 1

def get_hour_delta(self, precision):
Expand Down
1 change: 1 addition & 0 deletions skins/weewx-wdc/includes/html-head.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
diagramWindDirOrdinals: $diagramWindDirOrdinals,
ordinalCompass: $get_ordinates,
windRoseColors: $jsonize($DisplayOptions.get('windRose_colors', ["rgb(243, 206, 201)", "#e7a4b6", "#cd7eaf", "#a262a9", "#6f4d96", "#3d3b72"])),
units: $unit.unit_type_dict
};
</script>

Expand Down
7 changes: 7 additions & 0 deletions skins/weewx-wdc/src/js/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ export const getyScaleOffset = (obs: string): number => {
offset = 1;
}

if (
(obs === "pressure" || obs === "barometer") &&
(window as any).weewxWdcConfig.units.group_pressure === "inHg"
) {
offset = 0.1;
}

return offset;
};

Expand Down

0 comments on commit c1d83e9

Please sign in to comment.