avoid crash on incomplete config.toml file

This commit is contained in:
Stefan Allius
2023-10-12 23:04:54 +02:00
parent 3adf968a59
commit a2dfb4c1a6

View File

@@ -125,7 +125,7 @@ class Message(metaclass=IterRegistry):
else:
self.node_id = ''
self.sug_area = ''
if not inverters['allow_all']:
if 'allow_all' not in inverters or not inverters['allow_all']:
self.unique_id = None
logger.warning(f'ignore message from unknow inverter! (SerialNo: {serial_no})')
return