Test and fix parsing of gas unit.
This commit is contained in:
parent
cf771776cd
commit
fe5caa9126
@ -31,7 +31,7 @@ class MBusObjectV2_2(DSMRObject):
|
||||
|
||||
@property
|
||||
def unit(self):
|
||||
return self.values[4]['unit']
|
||||
return self.values[4]['value']
|
||||
|
||||
|
||||
class CosemObject(DSMRObject):
|
||||
|
@ -35,4 +35,6 @@ def test_parse_v2_2():
|
||||
result = parser.parse(TELEGRAM_V2_2)
|
||||
|
||||
assert float(result[CURRENT_ELECTRICITY_USAGE].value) == 1.01
|
||||
assert result[CURRENT_ELECTRICITY_USAGE].unit == 'kW'
|
||||
assert float(result[GAS_METER_READING].value) == 1.001
|
||||
assert result[GAS_METER_READING].unit == 'm3'
|
||||
|
Loading…
Reference in New Issue
Block a user