Pass provider information to lower level
This commit is contained in:
parent
7fa83bab31
commit
cf4cd8cf40
1 changed files with 6 additions and 5 deletions
|
@ -76,12 +76,16 @@ def get_temp(deveui, payload):
|
|||
|
||||
return res
|
||||
|
||||
def decode_adeunis(pkg):
|
||||
def decode_adeunis(provider, pkg):
|
||||
data = pkg.split(":")
|
||||
|
||||
deveui = data[0]
|
||||
payload = data[1]
|
||||
|
||||
# ttn -> base64 encoded
|
||||
if provider == "ttn":
|
||||
payload = base64.b64decode(payload)
|
||||
|
||||
res = []
|
||||
|
||||
# Only handle known devices
|
||||
|
@ -94,11 +98,8 @@ def decode_adeunis(pkg):
|
|||
return res
|
||||
|
||||
def nodered_adeunisrf(provider, data):
|
||||
# ttn -> base64 encoded
|
||||
if provider == "ttn":
|
||||
data = base64.b64decode(data)
|
||||
res = decode_adeunis(provider, data)
|
||||
|
||||
res = decode_adeunis(data)
|
||||
if not res:
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in a new issue