some init logging to catch whether bumper or sucks is handling pings

This commit is contained in:
bittles
2023-01-02 22:28:22 -05:00
parent cd4c8069bc
commit aea75338f6
+6 -1
View File
@@ -451,21 +451,26 @@ 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 to bumper ******************") _LOGGER.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']: if not self.vacuum['iotmq']:
_LOGGER.info("connecting to xmpp server for bumper ******************")
self.xmpp.connect_and_wait_until_ready() self.xmpp.connect_and_wait_until_ready()
self.xmpp.schedule('Ping', 300, lambda: self.send_ping(), repeat=True) self.xmpp.schedule('Ping', 300, lambda: self.send_ping(), repeat=True)
else: else:
_LOGGER.info("connecting to mqtt server for bumper ******************")
self.iotmq.connect_and_wait_until_ready() self.iotmq.connect_and_wait_until_ready()
self.iotmq.schedule(30, self.send_ping) self.iotmq.schedule(30, self.send_ping)
# keep rest of bmartins fork intact # keep rest of bmartins fork intact
else: else:
_LOGGER.info("connecting to NOT bumper ******************")
if not self.vacuum['iotmq']: if not self.vacuum['iotmq']:
_LOGGER.info("connecting to NOT bumper, xmpp server ******************")
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', 30, lambda: self.send_ping(), repeat=True)
else: else:
_LOGGER.info("connecting to NOT bumper, mqtt server ******************")
self.iotmq.connect_and_wait_until_ready() self.iotmq.connect_and_wait_until_ready()
self.iotmq.schedule(30, self.send_ping) self.iotmq.schedule(30, self.send_ping)
#self.xmpp.connect_and_wait_until_ready() #Leaving in case xmpp is given to iotmq in the future #self.xmpp.connect_and_wait_until_ready() #Leaving in case xmpp is given to iotmq in the future