Skip to content
Back to top
View this page

# aiohomeconnect.cli package

Provide a CLI for Home Connect API.

aiohomeconnect.cli.authorize(client_id: str, client_secret: str) → None

  Authorize the client.

aiohomeconnect.cli.get_appliances(client_id: str, client_secret: str) → None

  Get the appliances.

aiohomeconnect.cli.get_operation_state(client_id: str, client_secret: str, ha_id: str) → None

  Get the operation state of the device.

aiohomeconnect.cli.set_selected_program_option(client_id: str, client_secret: str, ha_id: str, *, option_key: OptionKey, bool_value: bool | None = None, float_value: float | None = None, string_value: str | None = None) → None

  Set an option of a program on an appliance.

aiohomeconnect.cli.subscribe_all_appliances_events(client_id: str, client_secret: str) → None

  Subscribe and print events from all the appliances.

aiohomeconnect.cli.subscribe_appliance_events(client_id: str, client_secret: str, ha_id: str) → None

  Subscribe and print events from one appliance.

## Submodules

## aiohomeconnect.cli.client module

Provide a CLI client for Home Connect API.

class aiohomeconnect.cli.client.Auth(httpx_client: AsyncClient, host: str, token_manager: TokenManager)

  Bases: `AbstractAuth`

  Implement the authentication.

  async async_get_access_token() → str

    Return a valid access token.

class aiohomeconnect.cli.client.CLIClient(client_id: str, client_secret: str, redirect_uri: str | None = None, scope: str | None = None)

  Bases: `Client`

  Represent a CLI client for Home Connect API.

class aiohomeconnect.cli.client.TokenManager(client_id: str, client_secret: str, redirect_uri: str | None = None, scope: str | None = None)

  Bases: `object`

  Manage the tokens for authentication.

  async create_authorization_url() → str

    Create the authorization URL.

  async fetch_access_token(code: str) → dict[str, Any]

    Fetch the access token.

  is_token_valid() → bool

    Check if the token is valid.

  async load_access_token() → None

    Load the access token.

  async refresh_access_token() → None

    Refresh the access token.

  async save_access_token() → None

    Save the access token.