solaar: handle devices with all-zero modelId

This commit is contained in:
Peter F. Patel-Schneider 2022-04-07 15:18:27 -04:00
parent 37bc1d7bd0
commit 8ac8fe6401
1 changed files with 4 additions and 2 deletions

View File

@ -173,8 +173,10 @@ _yaml.add_representer(_NamedInt, named_int_representer)
# So new entries are not created for unseen off-line receiver-connected devices except for those with protocol 1.0 # So new entries are not created for unseen off-line receiver-connected devices except for those with protocol 1.0
def persister(device): def persister(device):
def match(wpid, serial, modelId, unitId, c): def match(wpid, serial, modelId, unitId, c):
return ((wpid and wpid == c.get(_KEY_WPID) and serial and serial == c.get(_KEY_SERIAL)) return ((wpid and wpid == c.get(_KEY_WPID) and serial and serial == c.get(_KEY_SERIAL)) or (
or (modelId and modelId == c.get(_KEY_MODEL_ID) and unitId and unitId == c.get(_KEY_UNIT_ID))) modelId and modelId != '000000000000' and modelId == c.get(_KEY_MODEL_ID) and unitId
and unitId == c.get(_KEY_UNIT_ID)
))
if not _config: if not _config:
_load() _load()