solaar: only create configuration entries for off-line devices if they have a serial number

This commit is contained in:
Peter F. Patel-Schneider 2022-04-26 09:01:27 -04:00
parent fb74e3b657
commit 0c4e4fcf7f
1 changed files with 3 additions and 1 deletions

View File

@ -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)