I found bug into GXDLMSObjectCollection.load() method
Deserialization of Item
<GXDLMSData>
<Value Type="3">0</Value>
</GXDLMSData>
return object_data.value=True
At method GXDLMSConverter.changeType() instead
ret = bool(value)
should fix on
ret = bool(int(value))
Hi,
Hi,
You are giving the integer as a string. You need to change it like this:
GXXmlReader.GXDLMSConverter.changeType(0, DataType.BOOLEAN)
This is not changed for now because a meter returns a boolean value as an integer value.
BR,
Mikko
Hi,
Hi,
> You need to change it like this GXXmlReader.GXDLMSConverter.changeType(0, DataType.BOOLEAN)
No, i use Gurux.DLMS.GXDLMSObjectCollection.load(filename). Changes need to be made in Gurux.DLMS module https://github.com/Gurux/Gurux.DLMS.Python/blob/0e232efdeb44c39ac5a7205…
In method Gurux.DLMS.GXXmlReader.readElementContentAsObject():
str_ = self.currentElement.text # str_ = '0' - str type, not integer!
ret = GXDLMSConverter.changeType(str_, uiType) # uiType=DataType.BOOLEAN
# ret = True
Hi,
Hi,
Yes, you are right. Thank you for pointing this out. :-)
This is fixed and tested with Windows and Linux. The new version is released shortly.
BR,
Mikko
Hi,
Hi,
Version 120 is released and your name is added for credits.
BR,
Mikko