This commit is contained in:
Geoff Whittington
2022-08-22 00:36:53 -04:00
parent 86c8491a34
commit 343d7a377a
+7 -4
View File
@@ -156,16 +156,19 @@ class WebhookPlugin(Plugin):
def do_action(self, packet):
if type(packet) is not dict:
self.logger.warning("Packet is not dict")
return packet
try:
packet = json.loads(packet)
except:
self.logger.warning("Packet is not dict")
return packet
if "active" in self.config and not self.config["active"]:
return packet
if "position" not in packet["decoded"]:
if 'body' not in self.config:
self.logger.warning("Missing config: body")
return packet
import json
import requests
position = packet["decoded"]["position"] if "position" in packet["decoded"] else None