comparison iec1107.py @ 13:156313694bbb default tip

Use the correct exponent for Watts (ie 0 not 1).
author Daniel O'Connor <darius@dons.net.au>
date Sat, 18 Jan 2014 05:23:02 +0000
parents c1892bd1460a
children
comparison
equal deleted inserted replaced
12:b4de1b6f8f78 13:156313694bbb
167 elif units[0] == 'G': 167 elif units[0] == 'G':
168 exp = 9 168 exp = 9
169 elif units[1] == 'T': 169 elif units[1] == 'T':
170 exp = 12 170 exp = 12
171 else: 171 else:
172 exp = 1 172 exp = 0
173 return float(count) * 10 ** exp 173 return float(count) * 10 ** exp
174 174
175 def __str__(self): 175 def __str__(self):
176 return 'Time: %s, Meter: %s, Import: %d Wh, Export: %d Wh' % (self.readdate.strftime('%Y/%m/%d %H:%M'), 176 return 'Time: %s, Meter: %s, Import: %d Wh, Export: %d Wh' % (self.readdate.strftime('%Y/%m/%d %H:%M'),
177 self.meterid, self.importWh, self.exportWh) 177 self.meterid, self.importWh, self.exportWh)