Skip to content

Commit

Permalink
sdp: rename check_command to check_reply as this is more suitable
Browse files Browse the repository at this point in the history
  • Loading branch information
onkelandy committed Aug 4, 2024
1 parent 1842588 commit ada53c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/model/sdp/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ def on_disconnect(self, by=None):
if self._params[PLUGIN_ATTR_CB_ON_DISCONNECT]:
self._params[PLUGIN_ATTR_CB_ON_DISCONNECT](by)

def check_command(self, command, value):
def check_reply(self, command, value):
"""
checking commands, e.g. for resend feature
checking reply, e.g. for resend feature
"""
return self._check_command(command, value)
return self._check_reply(command, value)

#
#
Expand Down Expand Up @@ -245,7 +245,7 @@ def _send(self, data_dict, **kwargs):
self.logger.debug(f'simulating to send data {data_dict}...')
return self.dummy

def _check_command(self, command, value):
def _check_reply(self, command, value):
"""
overwrite with checking of data
Return False by default
Expand Down
4 changes: 2 additions & 2 deletions lib/model/sdp/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _send(self, data_dict, **kwargs):
self.logger.debug(f'{self.__class__.__name__} _send called with {data_dict}')
return self._connection.send(data_dict, **kwargs)

def _check_command(self, command, value):
def _check_reply(self, command, value):
return False

def _get_connection(self, use_callbacks=False, name=None):
Expand Down Expand Up @@ -512,7 +512,7 @@ def _store_commands(self, resend_info, data_dict):
return True
return False

def _check_command(self, command, value):
def _check_reply(self, command, value):
"""
Check if the command is in _sending dict and if response is same as expected or not
Expand Down
2 changes: 1 addition & 1 deletion lib/model/smartdeviceplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ def on_data_received(self, by, data, command=None):
else:
if custom:
command = command + CUSTOM_SEP + custom
self._connection.check_command(command, value) # needed for resend protocol
self._connection.check_reply(command, value) # needed for resend protocol
self._dispatch_callback(command, value, by)
self._process_additional_data(command, data, value, custom, by)

Expand Down

0 comments on commit ada53c3

Please sign in to comment.