From f8506d6d259d93bb205ede8c10fe2ba93e897f28 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 11 Jun 2018 22:41:20 +0200 Subject: [PATCH] Added comment to explain the reasons for sudo in the switchbot plugin --- platypush/plugins/switch/switchbot/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platypush/plugins/switch/switchbot/__init__.py b/platypush/plugins/switch/switchbot/__init__.py index 74920d625..b468e673f 100644 --- a/platypush/plugins/switch/switchbot/__init__.py +++ b/platypush/plugins/switch/switchbot/__init__.py @@ -100,6 +100,10 @@ class SwitchSwitchbotPlugin(SwitchPlugin): errors = [] try: + # XXX this requires sudo and it's executed in its own process + # because the Switchbot plugin requires root privileges to send + # raw bluetooth messages on the interface. Make sure that the user + # that runs platypush has the right permissions to run this with sudo output = subprocess.check_output(( 'sudo python3 -m platypush.plugins.switch.switchbot ' + '--device {} ' +