pydrawise.auth

pydrawise.auth

Authentication support for the Hydrawise v2 GraphQL API.

HybridAuth

HybridAuth(username: str, password: str, api_key: str)

Bases: Auth, RestAuth

Authentication support for the Hydrawise GraphQL & REST APIs.

Initializer.

Parameters:
  • username (str) –

    The username to use for authenticating with the Hydrawise GraphQL service.

  • password (str) –

    The password to use for authenticating with the Hydrawise GraphQL service.

  • api_key (str) –

    The API key to use for authenticating with the Hydrawise REST service.

check async

check() -> bool

Validates that both the GraphQL credentials and the REST API key are valid.

RestAuth

RestAuth(api_key: str)

Bases: BaseAuth

Authentication support for the Hydrawise REST API.

Initializer.

Parameters:
  • api_key (str) –

    The API key to use for authenticating with the Hydrawise REST service.

check async

check() -> bool

Validates that the credentials are valid.

get async

get(path: str, **kwargs) -> dict

Perform an authenticated GET request and return the JSON response.