octopus.capture.device

class octopus.capture.device.DevicePropertiesCapture(device, output_dir, output_filename='device.json')[source]

Bases: AbstractCapture

Class to capture and save device properties.

__init__(device, output_dir, output_filename='device.json')[source]

Initializes the capture of device properties.

Parameters:
  • device (AndroidDevice) – Instance of AndroidDevice to capture properties from.

  • output_dir (Path) – Directory to save the output file.

  • output_filename (str | None) – Name of the output file, defaults to device.json.

get_output_file()[source]

Returns the full path to the output file.

Returns:

The output file path.

Return type:

Path

get_result()[source]

Returns a dictionary with capture result details.

Returns:

Dictionary containing file name, start/end times, and capture duration.

Return type:

dict

start_capture()[source]

Starts the device properties capture process.

This method records the start time, retrieves device properties using the AndroidDevice instance, and saves them to the output file in JSON format. The end time is recorded after saving.

stop_capture()[source]

Stop the capture process.

This method should be implemented by subclasses to terminate the capture mechanism.

Raises:

NotImplementedError – If not implemented in subclass.

name: str = 'device'

The name of the capture type.