Try to make a dict

This commit is contained in:
Geoff Whittington
2022-08-22 00:19:30 -04:00
parent 30320875a2
commit 940542f856

View File

@@ -305,8 +305,11 @@ class SendPlugin(Plugin):
def do_action(self, packet):
if type(packet) is not dict:
self.logger.error(f"Packet is not dict")
return packet
try:
packet = json.loads(packet)
except:
self.logger.error("Packet is not a dict")
return packet
if self.config["device"] not in self.devices:
self.logger.error(f"Missing interface for device {self.config['device']}")