aiovantage.discovery
¶
Helper functions for discovering details about Vantage controllers.
Classes:
-
VantageControllerDetails–Details about a queried Vantage controller.
Functions:
-
get_controller_details–Discover Vantage controller details from given hostname/ip.
-
validate_credentials–Check if the given credentials are valid for the given controller.
-
get_serial_from_controller–Get the serial number of the given controller.
-
get_serial_from_hostname–Get the serial number from a Vantage mDNS hostname.
VantageControllerDetails
dataclass
¶
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:
-
VantageControllerDetails | None–A DiscoveredVantageController, or None if a controller could not be reached.
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:
-
ClientConnectionError–If a controller could not be reached.
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.