(self)
Tries to build the device's name based on its type and protocol name but falls back on a default name if that doesn't work.
Tries to build the device's name based on its type and protocol name but falls back on a default name if that doesn't work.
Tries to build the device s name based on its type and protocol name but falls back on a default name if that doesn t work .
def _set_name(self):
        """Tries to build the device's name based on its type and protocol name but falls back on a default name if that doesn't work."""

        try:
            name = ('%s serial %s' % (self._protocol.name, self.device_type)).title()
        except Exception:
            name = 'Unknown Serial Device'
        self.device_name = name
def _set_name ( self ) : try : name = ( '%s serial %s' % ( self . _protocol . name , self . device_type ) ) . title ( ) except Exception : name = 'Unknown Serial Device' self . device_name = name