poco.agent module

class PocoAgent(hierarchy, input, screen, command=None)[source]

Bases: object

This is the agent class for poco to communicate with target device.

This class is an aggregation of 4 major interfaces for now.

  • HierarchyInterface: defines the hierarchy accessibility methods such as dump(crawl the whole UI tree), getAttr(retrieve attribute value by name)

  • InputInterface: defines the simulated input methods to allow inject simulated input on target device

  • ScreenInterface: defines methods to access the screen surface

  • CommandInterface: defines methods to communicate with target device in arbitrary way. This is optional.

property driver

Return the driver of this agent related to. None if the driver is not ready to bind.

Returns:

the driver of this agent related to.

Return type:

inherit from Poco

get_sdk_version()[source]

Retrieve the sdk version from remote runtime. Each poco agent implementation should override this method.

Returns:

version string of the poco sdk. usually in “0.0.0” format. None if not provided by poco sdk.

Return type:

str

property rpc

Return the interface of this agent handled.

Returns:

the rpc interface of this agent handled.

Return type:

object

Raises:

NotImplementedError – raises if the agent implementation dose not expose the rpc interface to user.