avoid crash on incomplete config.toml file
This commit is contained in:
@@ -125,7 +125,7 @@ class Message(metaclass=IterRegistry):
|
|||||||
else:
|
else:
|
||||||
self.node_id = ''
|
self.node_id = ''
|
||||||
self.sug_area = ''
|
self.sug_area = ''
|
||||||
if not inverters['allow_all']:
|
if 'allow_all' not in inverters or not inverters['allow_all']:
|
||||||
self.unique_id = None
|
self.unique_id = None
|
||||||
logger.warning(f'ignore message from unknow inverter! (SerialNo: {serial_no})')
|
logger.warning(f'ignore message from unknow inverter! (SerialNo: {serial_no})')
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user