From ada53c3a9848bc89c6ad8e1259f920ab6966a092 Mon Sep 17 00:00:00 2001 From: Onkel Andy Date: Sun, 4 Aug 2024 02:04:37 +0200 Subject: [PATCH] sdp: rename check_command to check_reply as this is more suitable --- lib/model/sdp/connection.py | 8 ++++---- lib/model/sdp/protocol.py | 4 ++-- lib/model/smartdeviceplugin.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/model/sdp/connection.py b/lib/model/sdp/connection.py index 92532d649c..53df675a27 100644 --- a/lib/model/sdp/connection.py +++ b/lib/model/sdp/connection.py @@ -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) # # @@ -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 diff --git a/lib/model/sdp/protocol.py b/lib/model/sdp/protocol.py index 34c16abaac..325275fb99 100644 --- a/lib/model/sdp/protocol.py +++ b/lib/model/sdp/protocol.py @@ -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): @@ -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 diff --git a/lib/model/smartdeviceplugin.py b/lib/model/smartdeviceplugin.py index 64ea2a56c8..72ec187a68 100644 --- a/lib/model/smartdeviceplugin.py +++ b/lib/model/smartdeviceplugin.py @@ -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)