@@ -579,11 +579,13 @@ class GPIOSysFSExport(ResourceExport):
579579
580580 def __attrs_post_init__ (self ):
581581 super ().__attrs_post_init__ ()
582- local_cls_name = self .cls
583- self .data ['cls' ] = f"Network{ self .cls } "
584- from ..resource import base
585- local_cls = getattr (base , local_cls_name )
586- self .local = local_cls (target = None , name = None , ** self .local_params )
582+ if self .cls == "SysfsGPIO" :
583+ from ..resource .base import SysfsGPIO
584+ self .local = SysfsGPIO (target = None , name = None , ** self .local_params )
585+ elif self .cls == "MatchedSysfsGPIO" :
586+ from ..resource .udev import MatchedSysfsGPIO
587+ self .local = MatchedSysfsGPIO (target = None , name = None , ** self .local_params )
588+ self .data ['cls' ] = "NetworkSysfsGPIO"
587589 self .export_path = Path (GPIOSysFSExport ._gpio_sysfs_path_prefix ,
588590 f'gpio{ self .local .index } ' )
589591 self .system_exported = False
@@ -624,6 +626,7 @@ def _stop(self, start_params):
624626 unexport .write (str (index ).encode ('utf-8' ))
625627
626628exports ["SysfsGPIO" ] = GPIOSysFSExport
629+ exports ["MatchedSysfsGPIO" ] = GPIOSysFSExport
627630
628631
629632@attr .s
0 commit comments