From 318ab0babc35fff62817b8d10ce87674f5ba4a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Keresztury?= Date: Thu, 21 Nov 2019 19:37:38 +0100 Subject: [PATCH 1/3] Added comment about dependencies to BitBucketConverter.py --- BitBucketConverter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BitBucketConverter.py b/BitBucketConverter.py index be97958..a297c91 100644 --- a/BitBucketConverter.py +++ b/BitBucketConverter.py @@ -10,6 +10,8 @@ # Editor: Portisch, henfri #------------------------------------------------------------------------------- +# Requires pillow and pycurl python packages from pip or your favourite package manager + # Interactive Process to learn Codes: # -Run rfraw 177 in your SonOff console -Push all your remote (each Button 2-3 times) # -Save everything from the console that happened after rfraw 177 to a file, e.g. console.txt From 9e0bb6c5f61fbf922b11a405e1c61422cff1f5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Keresztury?= Date: Thu, 21 Nov 2019 19:38:44 +0100 Subject: [PATCH 2/3] Fixed search string to work with newer Tasmota firmwares --- BitBucketConverter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BitBucketConverter.py b/BitBucketConverter.py index a297c91..4b90f77 100644 --- a/BitBucketConverter.py +++ b/BitBucketConverter.py @@ -286,7 +286,7 @@ def parse_file(fn): commands={} with open(fn) as f: for line in f: - if '{"RfRaw":{"Data":"AA B1' in line: + if '"RfRaw":{"Data":"AA B1' in line: print("###### Processing line {0} ######".format(line)) res=main(filterInputStr(line) , options.repeat) From d20594d52f21a966a11d4afb35a45d6e5a8606bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Keresztury?= Date: Thu, 21 Nov 2019 20:02:09 +0100 Subject: [PATCH 3/3] Fixed URL to reflect new Tasmota endpoint formats --- BitBucketConverter.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/BitBucketConverter.py b/BitBucketConverter.py index 4b90f77..321da49 100644 --- a/BitBucketConverter.py +++ b/BitBucketConverter.py @@ -34,6 +34,12 @@ from PIL import Image, ImageFont, ImageDraw from os.path import exists from time import sleep +try: + # python 3 + from urllib.parse import urlencode +except ImportError: + # python 2 + from urllib import urlencode # Output: # Example: AA B0 23 04 14 0224 03FB 0BF4 1CAC 23011010011001010110101001100101011010100101100110 55 @@ -71,8 +77,11 @@ def sendCommand(szOutFinal, mydevice): #buffer = StringIO() mydevice.replace("http://","").replace("/","") buffer = BytesIO() - url = str("http://{}/ax?c2=191&c1=RfRaw%20".format(mydevice)) - url += szOutFinal.replace(" ","%20") + baseurl = str("http://{}/cm?".format(mydevice)) + query = { + "cmnd": "BackLog RfRaw {}; RfRaw 0".format(szOutFinal) + } + url = baseurl + urlencode(query) print(url) print("Sending command to bridge") c = pycurl.Curl()