pb_client.service.Service.connect_hub
async
¶
connect_hub(*, hub_id=None, name=None, transport=None)
Connect to a hub and leave it connected.
The connection outlives this client: that is the point of the service.
With neither hub_id nor name, the hub is the one chosen with
use_hub if there is one;
otherwise one already connected; otherwise the only hub switched on.
Several hubs switched on and nothing to say which is refused rather
than guessed at.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hub_id
|
str | None
|
The hub's id, from scan. |
None
|
name
|
str | None
|
Connect to the hub with this name instead. One already connected is handed back; several switched on are refused. |
None
|
transport
|
str | None
|
Reach the hub this way, such as |
None
|
Returns:
| Type | Description |
|---|---|
HubInfo
|
The connected hub. If it was connected already, it is handed back |
HubInfo
|
as it is, with |
Raises:
| Type | Description |
|---|---|
JsonRpcError
|
With |