Skip to content

aiovantage.discovery

Helper functions for discovering details about Vantage controllers.

Classes:

Functions:

VantageControllerDetails dataclass

VantageControllerDetails(host: str, supports_ssl: bool, requires_auth: bool)

Details about a queried Vantage controller.

get_controller_details async

get_controller_details(host: str, ssl_context_factory: Callable[[], SSLContext] | None = None) -> VantageControllerDetails | None

Discover Vantage controller details from given hostname/ip.

Parameters:

  • host (str) –

    The hostname/ip of a Vantage controller.

  • ssl_context_factory (Callable[[], SSLContext] | None, default: None ) –

    An optional function to create an SSLContext.

Returns:

validate_credentials async

validate_credentials(host: str, username: str, password: str, *, ssl: SSLContext | bool = True, ssl_context_factory: Callable[[], SSLContext] | None = None) -> bool

Check if the given credentials are valid for the given controller.

Parameters:

  • host (str) –

    The hostname/ip of the Vantage controller.

  • ssl (SSLContext | bool, default: True ) –

    Whether to use SSL when connecting to the controller.

  • username (str) –

    The username to check.

  • password (str) –

    The password to check.

  • ssl_context_factory (Callable[[], SSLContext] | None, default: None ) –

    An optional function to create an SSLContext.

Returns:

  • bool –

    True if the credentials are valid, False otherwise.

Raises:

get_serial_from_controller async

get_serial_from_controller(host: str, username: str | None = None, password: str | None = None, *, ssl: SSLContext | bool = True, ssl_context_factory: Callable[[], SSLContext] | None = None) -> int | None

Get the serial number of the given controller.

Parameters:

  • host (str) –

    The hostname/ip of the Vantage controller.

  • username (str | None, default: None ) –

    The username to check, or None if not required.

  • password (str | None, default: None ) –

    The password to check, or None if not required.

  • ssl (SSLContext | bool, default: True ) –

    Whether to use SSL when connecting to the controller.

  • ssl_context_factory (Callable[[], SSLContext] | None, default: None ) –

    An optional function to create an SSLContext.

Returns:

  • int | None –

    The serial number of the controller, or None if not found.

get_serial_from_hostname

get_serial_from_hostname(hostname: str) -> str | None

Get the serial number from a Vantage mDNS hostname.

Parameters:

  • hostname (str) –

    The hostname to parse.

Returns:

  • str | None –

    The serial number of the controller, or None if not found.