Skip to content

Commit

Permalink
Merge pull request #11 from RikScheffer/master
Browse files Browse the repository at this point in the history
add support for usernames with special characters
  • Loading branch information
sincze authored Jun 7, 2021
2 parents aa7afab + dac4b0e commit 4f016f3
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

1 comment on commit 4f016f3

@sincze
Copy link
Owner Author

@sincze sincze commented on 4f016f3 Aug 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Addition.

Please # to comment.