feat: map missing printer models to device types and ignore printers or models
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
2db5e1f251
commit
b1cfdf7a5c
6 files changed
+298
-8
No files matched your search
@@ -172,6 +172,10 @@ class APSyncEngine(ClientSyncEngine):
|
||||
"""``(manufacturer, model, platform or None)`` of a new device."""
|
||||
return MANUFACTURER, ap["model"] or "Access Point", PLATFORM
|
||||
|
||||
def _mapped_type(self, ap):
|
||||
"""Device type ID chosen by the user instead of creating one, or ``None``."""
|
||||
return None
|
||||
|
||||
def _extra_payload(self, ap):
|
||||
"""Additional fields for a new device."""
|
||||
return {}
|
||||
@@ -326,7 +330,8 @@ class APSyncEngine(ClientSyncEngine):
|
||||
raise APImportError("keine Geräterolle gewählt")
|
||||
manufacturer, model, platform = self._identity(ap)
|
||||
manufacturer_id = self._manufacturer(manufacturer, report, dry_run)
|
||||
type_id = self._device_type(manufacturer, manufacturer_id, model, report, dry_run)
|
||||
type_id = self._mapped_type(ap) or self._device_type(manufacturer, manufacturer_id, model, report,
|
||||
dry_run)
|
||||
platform_id = self._platform(platform, report, dry_run) if platform else None
|
||||
# An explicitly chosen tenant wins, otherwise the one of the site.
|
||||
tenant_id = placement.get("tenant") or self._site_tenant(site_id)
|
||||
|
||||
Reference in new issue
Block a user