diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/profile.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/profile.py b/core/profile.py index fdd3a48..39cb3ca 100644 --- a/core/profile.py +++ b/core/profile.py @@ -131,6 +131,18 @@ class ProfileManager: ProfileManager.apply(profile, registry, processor, ...) """ + # Plugin device factories registered at runtime (device_type → class) + _extra_factories: dict = {} + + @staticmethod + def register_device_factory(device_type: str, factory): + """Register a plugin device class so it can be restored from profiles.""" + ProfileManager._extra_factories[device_type] = factory + + @staticmethod + def unregister_device_factory(device_type: str): + ProfileManager._extra_factories.pop(device_type, None) + # ── Capture ────────────────────────────────────────────────────────────── @staticmethod @@ -234,7 +246,7 @@ class ProfileManager: ) # ── Devices ────────────────────────────────────────────────────── - _DEVICE_FACTORIES = {} + _DEVICE_FACTORIES = dict(ProfileManager._extra_factories) try: from devices.arduino_device import ArduinoDevice _DEVICE_FACTORIES["arduino"] = ArduinoDevice |
