Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change xmpp ping from 30 to 300s to not spam robot, add ifs for mqtt … #1

Merged
merged 1 commit into from
Jan 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions custom_components/ecovacs/sucksbumper.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,15 @@ def __init__(self, user, domain, resource, secret, vacuum, continent, server_add
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']:
Expand Down