def sendMessage(self, data, method, url):
conn = http.client.HTTPConnection(Parameters["Address"] + ":1400")
headers = {"Content-Type": 'text/xml; charset="utf-8"', "SOAPACTION": method}
conn.request("POST", url, data, headers)
response = conn.getresponse()
conn.close()
if response.status == 200:
data = response.read().decode("utf-8")
LogMessage(str(data))
self.parseMessage(data)
else:
Domoticz.Error("Unexpected response status received in function sendMessage (" + str(response.status) + ", " + str(response.reason) + "). \
The following command is sent: " + str(method) + ", " + str(url))
return
# Process message from Sonos
评论列表
文章目录