Convert BinCode to int when reading a map with decimal values

This commit is contained in:
Jan Petykiewicz 2021-11-12 14:20:35 -08:00
parent 65533b8d99
commit 2b8b50d084

View File

@ -96,7 +96,11 @@ def read_devices(el_map: ElementTree.Element) -> List[Device]:
f'with attributes {el_entry.attrib}')
continue
bin_code = attrib['BinCode']
if bin_type == 'Decimal':
bin_code = int(attrib['BinCode'])
else:
bin_code = int(attrib['BinCode'])
if bin_code in device.bin_pass:
logger.error(f'Bin code {bin_code} was repeated; ignoring later entry!')
continue