solaar: only create configuration entries for off-line devices if they have a serial number
This commit is contained in:
parent
fb74e3b657
commit
0c4e4fcf7f
|
@ -186,7 +186,9 @@ def persister(device):
|
||||||
entry = c
|
entry = c
|
||||||
break
|
break
|
||||||
if not entry:
|
if not entry:
|
||||||
if not device.online and device.protocol > 1.0: # don't create entry for unseen offline modern devices
|
if not device.online and not device.serial: # don't create entry for offline devices without serial number
|
||||||
|
if _log.isEnabledFor(_INFO):
|
||||||
|
_log.info('not creating persister for device %s', device.get('name'))
|
||||||
return
|
return
|
||||||
entry = _DeviceEntry()
|
entry = _DeviceEntry()
|
||||||
_config.append(entry)
|
_config.append(entry)
|
||||||
|
|
Loading…
Reference in New Issue