From a9bd4d2d48105199f2aeaed2f93b47aa497ba157 Mon Sep 17 00:00:00 2001 From: bittles Date: Mon, 2 Jan 2023 19:54:11 -0500 Subject: [PATCH] change xmpp ping from 30 to 300s to not spam robot, add ifs for mqtt or xmpp robot --- custom_components/ecovacs/sucksbumper.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/custom_components/ecovacs/sucksbumper.py b/custom_components/ecovacs/sucksbumper.py index 90cda1a..b479aac 100644 --- a/custom_components/ecovacs/sucksbumper.py +++ b/custom_components/ecovacs/sucksbumper.py @@ -446,11 +446,15 @@ class VacBot(): def connect_and_wait_until_ready(self): # use bmartins exmaple if defining our own server, couldn't get this to work without defining, probably xmpp port but idk if self.server_address: - logging.info("connecting") + logging.info("connecting to bumper ******************") # self.xmpp.connect(self.server_address) # self.xmpp.process() - self.xmpp.connect_and_wait_until_ready() - self.xmpp.schedule('Ping', 30, lambda: self.send_ping(), repeat=True) + if not self.vacuum['iotmq']: + self.xmpp.connect_and_wait_until_ready() + self.xmpp.schedule('Ping', 300, lambda: self.send_ping(), repeat=True) + else: + self.iotmq.connect_and_wait_until_ready() + self.iotmq.schedule(30, self.send_ping) # keep rest of bmartins fork intact else: if not self.vacuum['iotmq']: