Added comment to explain the reasons for sudo in the switchbot plugin

This commit is contained in:
Fabio Manganiello 2018-06-11 22:41:20 +02:00
parent 933940c695
commit f8506d6d25

View file

@ -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 {} ' +