Skip to content

Commit

Permalink
add support for usernames with special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
RikScheffer committed Jun 4, 2021
1 parent aa7afab commit dac4b0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import hashlib
import json
import re # Needed to extract data from Some JSON result
import urllib.parse # Needed to encode request body messages

local = False
except ImportError:
Expand Down Expand Up @@ -152,7 +153,7 @@ def onConnect(self, Connection, Status, Description):
sendData = { 'Verb' : 'POST',
'URL' : '/newTwoLoginAPI.do',
'Headers' : self.apiRequestHeaders(),
'Data': "password="+password_md5+"&userName="+Parameters["Mode2"]
'Data': "password="+password_md5+"&userName="+urllib.parse.quote_plus(Parameters["Mode2"])
}
Domoticz.Debug("Step 1. Login SendData: "+str(sendData))
Connection.Send(sendData)
Expand Down

0 comments on commit dac4b0e

Please # to comment.