App Installation¶
-
class
libpebble2.services.install.
AppInstaller
(pebble, pbw_path, blobdb_client=None)¶ Installs an app on the Pebble via Pebble Protocol.
Parameters: - pebble (PebbleConnection) – The
PebbleConnection
over which to install the app. - pbw_path (str) – The path to the PBW file to be installed on the filesystem.
- blobdb_client (BlobDBClient) – An optional
BlobDBClient
to use, if one already exists. If omitted, one will be created.
-
install
()¶ Installs an app. Blocks until the installation is complete, or raises
AppInstallError
if it fails.While this method runs, “progress” events will be emitted regularly with the following signature:
(sent_this_interval, sent_total, total_size)
-
register_handler
(event, handler)¶ Registers a handler to be triggered by an event
Parameters: - event – The event to handle
- handler – The handler callable.
Returns: A handle that can be used to unregister the handler.
-
total_sent
= None¶ Total number of bytes sent so far.
-
total_size
= None¶ Total number of bytes to send.
-
unregister_handler
(handle)¶ Unregisters an event handler.
Parameters: handle – The handle returned from register_handler()
-
wait_for_event
(event, timeout=10)¶ Block waiting for the given event. Returns the event params.
Parameters: - event – The event to handle.
- timeout – The maximum time to wait before raising
TimeoutError
.
Returns: The event params.
- pebble (PebbleConnection) – The