From b40dee59006d4936f0a7ed723d4b3f25e2c56e4d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 29 Aug 2019 11:29:56 +1000 Subject: [PATCH] tools: stop live before starting it If for some reason the device is still in live mode from an earlier invocation, stop live mode first before we attempt to start a new one. Signed-off-by: Peter Hutterer --- tools/tuhi-live.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/tuhi-live.py b/tools/tuhi-live.py index 0fd07ac..8b5c885 100755 --- a/tools/tuhi-live.py +++ b/tools/tuhi-live.py @@ -126,6 +126,9 @@ def run_live(request_fd_queue, conn_fd): manager = tuhi.dbusclient.TuhiDBusClientManager() for device in manager.devices: + if device.live: + logger.info(f'{device} is already live, stopping first') + device.stop_live() logger.info(f'starting live on {device}, please press button on the device') request_fd_queue.put(os.getpid()) fd = reduction.recv_handle(conn_fd)