Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# DeviceAccess

This CDP domain is experimental.

- Types

- Commands

- Events

## Types

Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.

class RequestId

  Device request id.

class DeviceId

  A device id.

class PromptDevice(id_, name)

  Device information displayed in a user prompt to select a device.

  id_: `DeviceId`
  name: `str`

    Display name as it appears in a device request user prompt.

## Commands

Each command is a generator function. The return type `Generator[x, y, z]` indicates that the generator yields arguments of type `x`, it must be resumed with an argument of type `y`, and it returns type `z`. In this library, types `x` and `y` are the same for all commands, and `z` is the return type you should pay attention to. For more information, see Getting Started: Commands.

cancel_prompt(id_)

  Cancel a prompt in response to a DeviceAccess.deviceRequestPrompted event.

  Parameters:

    id –

  Return type:

    `Generator`[`Dict`[`str`, `Any`], `Dict`[`str`, `Any`], `None`]

disable()

  Disable events in this domain.

  Return type:

    `Generator`[`Dict`[`str`, `Any`], `Dict`[`str`, `Any`], `None`]

enable()

  Enable events in this domain.

  Return type:

    `Generator`[`Dict`[`str`, `Any`], `Dict`[`str`, `Any`], `None`]

select_prompt(id_, device_id)

  Select a device in response to a DeviceAccess.deviceRequestPrompted event.

  Parameters:

    - id –

    - device_id (`DeviceId`) –

  Return type:

    `Generator`[`Dict`[`str`, `Any`], `Dict`[`str`, `Any`], `None`]

## Events

Generally, you do not need to instantiate CDP events yourself. Instead, the API creates events for you and then you use the event’s attributes.

class DeviceRequestPrompted(id_, devices)

  A device request opened a user prompt to select a device. Respond with the selectPrompt or cancelPrompt command.

  id_: `RequestId`
  devices: `List`[`PromptDevice`]