diff --git a/demos/python/sdk_wireless_camera_control/open_gopro/features/access_point_feature.py b/demos/python/sdk_wireless_camera_control/open_gopro/features/access_point_feature.py index 9c5be56ea..35ac02df9 100644 --- a/demos/python/sdk_wireless_camera_control/open_gopro/features/access_point_feature.py +++ b/demos/python/sdk_wireless_camera_control/open_gopro/features/access_point_feature.py @@ -5,6 +5,7 @@ import asyncio import logging +from functools import partial from returns.pipeline import is_successful from returns.result import Result @@ -58,7 +59,7 @@ async def scan_wifi_networks(self, timeout: int = 60) -> Result[proto.ResponseGe async with GoproObserverDistinctInitial[ResponseStartScanning, NotifStartScanning]( gopro=self._gopro, update=ProtobufId(FeatureId.NETWORK_MANAGEMENT, ActionId.NOTIF_START_SCAN), - register_command=self._gopro.ble_command.scan_wifi_networks(), + register_command=lambda: self._gopro.ble_command.scan_wifi_networks(), ) as observable, asyncio.timeout(timeout): if observable.initial_response.result != EnumResultGeneric.RESULT_SUCCESS: return Result.from_failure(GoProError("Failed to start scanning.")) @@ -90,10 +91,12 @@ async def connect( # Are we already provisioned? if entry.scan_entry_flags & EnumScanEntryFlags.SCAN_FLAG_CONFIGURED: logger.info(f"Connecting to already provisioned network {ssid}...") - command = self._gopro.ble_command.request_wifi_connect(ssid=ssid) + command = partial(self._gopro.ble_command.request_wifi_connect, ssid=ssid) else: logger.info(f"Provisioning new network {ssid}...") - command = self._gopro.ble_command.request_wifi_connect_new(ssid=ssid, password=password) + command = partial( + self._gopro.ble_command.request_wifi_connect_new, ssid=ssid, password=password + ) async with GoproObserverDistinctInitial[ ResponseConnect | ResponseConnectNew, diff --git a/demos/python/sdk_wireless_camera_control/open_gopro/features/streaming/livestream.py b/demos/python/sdk_wireless_camera_control/open_gopro/features/streaming/livestream.py index 354968369..4512c24e0 100644 --- a/demos/python/sdk_wireless_camera_control/open_gopro/features/streaming/livestream.py +++ b/demos/python/sdk_wireless_camera_control/open_gopro/features/streaming/livestream.py @@ -79,10 +79,10 @@ async def get_livestream_status_observable( """ return await GoProObservable[NotifyLiveStreamStatus]( gopro=self.gopro, - register_command=self.gopro.ble_command.register_livestream_status( + register_command=lambda: self.gopro.ble_command.register_livestream_status( register=[EnumRegisterLiveStreamStatus.REGISTER_LIVE_STREAM_STATUS_STATUS] ), - unregister_command=self.gopro.ble_command.register_livestream_status( + unregister_command=lambda: self.gopro.ble_command.register_livestream_status( unregister=[EnumRegisterLiveStreamStatus.REGISTER_LIVE_STREAM_STATUS_STATUS] ), update=ProtobufId(FeatureId.QUERY, ActionId.LIVESTREAM_STATUS_NOTIF),