From 55fb285e23d7eaf9730fe24c74f68471f21c5747 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Sat, 18 Mar 2023 19:38:10 +0100 Subject: [PATCH] improve sendcommand --- tinytuya/Cloud.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinytuya/Cloud.py b/tinytuya/Cloud.py index 87e5d465..042b83f5 100644 --- a/tinytuya/Cloud.py +++ b/tinytuya/Cloud.py @@ -481,7 +481,7 @@ def getdps(self, deviceid=None): ) return response_dict - def sendcommand(self, deviceid=None, commands=None): + def sendcommand(self, deviceid=None, commands=None, uri='iot-03/devices/'): """ Send a command to the device """ @@ -492,7 +492,7 @@ def sendcommand(self, deviceid=None, commands=None): ERR_PARAMS, "Missing DeviceID and/or Command Parameters" ) - uri = 'iot-03/devices/%s/commands' % (deviceid) + uri += '%s/commands' % (deviceid) response_dict = self._tuyaplatform(uri,action='POST',post=commands) if not response_dict['success']: