- step: python3 server.py
- step: another terminal: python3 actest.py
- step: power on the Samsung AC
root@raspberrypi:~# cat actest.py
import requests
s = requests.Session()
headers = {'content-type': 'text/xml'}
resp = s.post("https://192.168.1.36:8888/devicetoken/request", data={"DeviceToken":"xxxxxxxxxxx"}, headers=headers, stream=True, verify=False, cert='/etc/openhab2/services/cert.pem')
root@raspberrypi:~#
root@raspberrypi:~# python3 actest.py
/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
root@raspberrypi:~#
After I powered on the Samsung AC (on python3 server.py terminal):
root@raspberrypi:~# python3 test.py
Listening on localhost:8889
----- Request Start ----->
Request path: /devicetoken/response
Content Length: 0
Request headers: Host: 192.168.1.235:8889
Accept: */*
X-API-Version : v1.0.0
Content-Type: application/json
Content-Length: 28
Request payload: b''
Body: <__main__.RequestHandler object at 0x76a038f0>
Request payload: b'{"DeviceToken":"r42iD2EW1a"}'
<----- Request End -----
192.168.1.36 - - [12/Feb/2018 21:55:11] "POST /devicetoken/response HTTP/1.1" 200 -
May this will help, mine is working well.