# UniTAP.dev.device

MODEL_TO_CLASS = {'UCD-500': <class 'UniTAP.dev.dev_5xx_roles.UCD500'>, 'UCD-424': <class 'UniTAP.dev.dev_4xx_roles.UCD424'>, 'UCD-422': <class 'UniTAP.dev.dev_4xx_roles.UCD422'>, 'UCD-400': <class 'UniTAP.dev.dev_4xx_roles.UCD400'>, 'UCD-340': <class 'UniTAP.dev.dev_3xx_roles.UCD340'>, 'UCD-323': <class 'UniTAP.dev.dev_3xx_roles.UCD323'>, 'UCD-301': <class 'UniTAP.dev.dev_3xx_roles.UCD301'>, 'UCD-240': <class 'UniTAP.dev.dev_3xx_roles.UCD240'>}
class NotExistingRoleSelected(builtins.Exception):

Redefinition of base exception. Define error of 'not existing role selected'.

##### Inherited Members

builtins.Exception
  Exception
builtins.BaseException
  with_traceback
  add_note
  args

class DeviceRoleIsAlreadySelected(builtins.Exception):

Redefinition of base exception. Define error of 'device role already selected'.

##### Inherited Members

builtins.Exception
  Exception
builtins.BaseException
  with_traceback
  add_note
  args

class TSIDevice:

Class `TSIDevice` ... Allows:

- Select role of the device `select_role`.
- Get and redefine OPF (Operator feedback dialog) handler `opf_handler`.

TSIDevice( io: UniTAP.libs.lib_tsi.tsi_io.DeviceIO, name: str, serial_number: str, roles: List[~RoleType])
def select_role(self, role_type: Type[~RoleType]) -> ~RoleType:

Function allows selecting role of the chosen device. For example: `UniTAP.dev.UCD500.DPSourceDPSink` - will be opened UCD-500 in role DisplayPort Source and Sink.

###### Arguments:

- role_type (RoleType) - one of the possible roles.

###### Returns:

> object of `RoleType` type. Selected role.

available_roles: list

Returns available list of roles.

###### Returns:

> object of list type.

opf_handler

Returns current OPF handler.

###### Returns:

> object of handler type.