hongtat / tasmota-connect

Add your Tasmota devices as SmartThings devices
GNU General Public License v3.0
86 stars 171 forks source link

Issue #8 Incorrect Password Encoding of complex characters. #9

Closed BlueFinBima closed 2 years ago

BlueFinBima commented 4 years ago

password needed to be properly url encoded, and also password field in the device configuration should be obfuscated.

hongtat commented 4 years ago

path: "/cm?user=" + (childSetting(childDevice.device.id, "username") ?: "") + "&password=" + (childSetting(childDevice.device.id, "password") ? URLEncoder.encode(childSetting(childDevice.device.id, "password")) : "") + "&cmnd=" + URLEncoder.encode(command),

The encode() throws error on null (empty) password. Could you try the above whether it works for you? I can't change the password field to "password"; this throws encryption error.

BlueFinBima commented 4 years ago

@hongtat , Apologies for the delay, I have not tested with no password (I presume you have) but the modified code works with my complex passwords. I suspect that the username should really be encoded as well, but I since people will recompile TASMOTA to change the username from the default, I don't think this is a significant issue. Thanks again for creating this, I know that it takes a lot of effort, so well done.