Skip to content

Commit 12a5464

Browse files
author
brentru
committed
convert ounces to grams
1 parent 5d12dcc commit 12a5464

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

adafruit_dymoscale.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ def weight(self):
7171
"""Weight in grams"""
7272
weight = self.get_scale_data()
7373
if self.units == OUNCES:
74-
self.units = 'oz'
75-
elif self.units == GRAMS:
76-
self.units = 'g'
74+
weight *= 28.35
75+
self.units = 'g'
7776
return weight
7877

7978
def toggle_unit_button(self, switch_units=False):

0 commit comments

Comments
 (0)