jvconnected.client

exception jvconnected.client.ClientError(msg, response_obj, data=None)[source]

Bases: Exception

exception jvconnected.client.ClientAuthError(msg, response_obj, data=None)[source]

Bases: ClientError

exception jvconnected.client.ClientNetworkError(msg, response_obj, data=None)[source]

Bases: ClientError

class jvconnected.client.Client(hostaddr: str, auth_user: str, auth_pass: str, hostport: int = 80)[source]

Bases: object

Http client wrapper

Parameters
  • hostaddr (str) – The network host address

  • auth_user (str) – Api username

  • auth_pass (str) – Api password

property session_id: Optional[str]

The SessionID stored in cookies, if available

async open()[source]

Open the Http client session and authenticate

async close()[source]

Close the client session

async request(command: str, params=None)[source]

Make an api request

Parameters
  • command (str) – The api command name

  • params (dict, optional) – Data parameters for the command (if needed)

Returns

The response data

Return type

dict