change xmpp ping from 30 to 300s to not spam robot, add ifs for mqtt or xmpp robot
This commit is contained in:
@@ -446,11 +446,15 @@ class VacBot():
|
|||||||
def connect_and_wait_until_ready(self):
|
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
|
# 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:
|
if self.server_address:
|
||||||
logging.info("connecting")
|
logging.info("connecting to bumper ******************")
|
||||||
# self.xmpp.connect(self.server_address)
|
# self.xmpp.connect(self.server_address)
|
||||||
# self.xmpp.process()
|
# self.xmpp.process()
|
||||||
|
if not self.vacuum['iotmq']:
|
||||||
self.xmpp.connect_and_wait_until_ready()
|
self.xmpp.connect_and_wait_until_ready()
|
||||||
self.xmpp.schedule('Ping', 30, lambda: self.send_ping(), repeat=True)
|
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
|
# keep rest of bmartins fork intact
|
||||||
else:
|
else:
|
||||||
if not self.vacuum['iotmq']:
|
if not self.vacuum['iotmq']:
|
||||||
|
|||||||
Reference in New Issue
Block a user