File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ def _mqtt_on_connect(
114114 connection_queue .set_result (True )
115115
116116 def _mqtt_on_message (self , * args , ** kwargs ):
117- self .received_message_since_last_disconnect = False
117+ self .received_message_since_last_disconnect = True
118118 client , __ , msg = args
119119 try :
120120 messages = self ._decoder (msg .payload )
@@ -238,13 +238,13 @@ async def _validate_connection(self) -> None:
238238 # If we should no longer keep the current connection alive...
239239 if not self .should_keepalive ():
240240 self ._logger .info ("Resetting Roborock connection due to keepalive timeout" )
241- if self .received_message_since_last_disconnect :
241+ if not self .received_message_since_last_disconnect :
242242 # If we have already tried to unsub and resub, and we are still in this state,
243243 # we should try to reconnect.
244244 return await self ._reconnect ()
245245 try :
246246 # Mark that we have tried to unsubscribe and resubscribe
247- self .received_message_since_last_disconnect = True
247+ self .received_message_since_last_disconnect = False
248248 if await self ._unsubscribe () != 0 :
249249 # If we fail to unsubscribe, reconnect to the broker
250250 return await self ._reconnect ()
You can’t perform that action at this time.
0 commit comments