summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2020-10-03 22:59:42 -0500
committerEugene Triguba <eugenetriguba@gmail.com>2020-10-03 22:59:42 -0500
commitac41bb61b4345f6b5e44a36c295d4a962f2fd961 (patch)
tree4ec6a7874a58a70dd4f723e97566264c83408f8d
parentFix typos (diff)
downloadlirc-ac41bb61b4345f6b5e44a36c295d4a962f2fd961.zip
Minor docstring tweaks and stop_repeat default parameters
-rw-r--r--lirc/client.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/lirc/client.py b/lirc/client.py
index cbd607b..28adba1 100644
--- a/lirc/client.py
+++ b/lirc/client.py
@@ -57,6 +57,9 @@ class Client:
return parser_data
def close(self):
+ """
+ Close the connection to the socket.
+ """
self.__connection.close()
def send(self, remote: str, key: str, repeat_count: int = 1) -> None:
@@ -78,7 +81,7 @@ class Client:
Send an lircd SEND_START command.
This will repeat the given key until
- stop_repeat is called.
+ stop_repeat() is called.
Args:
remote: The remote to use keys from.
@@ -91,7 +94,7 @@ class Client:
self.__last_send_start_key = key
self.__send_command(f"SEND_START {remote} {key}")
- def stop_repeat(self, remote: str = None, key: str = None) -> None:
+ def stop_repeat(self, remote: str = "", key: str = "") -> None:
"""
Send an lircd SEND_STOP command.
@@ -107,19 +110,15 @@ class Client:
Raises:
LircdCommandFailure: If the command fails.
"""
- if remote:
+ if remote != "":
remote_to_stop = remote
elif self.__last_send_start_remote:
remote_to_stop = self.__last_send_start_remote
- else:
- remote_to_stop = ""
- if key:
+ if key != "":
key_to_stop = key
elif self.__last_send_start_key:
key_to_stop = self.__last_send_start_key
- else:
- key_to_stop = ""
self.__send_command(f"SEND_STOP {remote_to_stop} {key_to_stop}")
@@ -197,7 +196,7 @@ class Client:
self, remote: str, key: str, repeat_count: int = 1, keycode: int = 0
) -> None:
"""
- The --allow-simulate command line option must be active for this
+ The --allow-simulate command line option to `lircd` must be active for this
command not to fail.
Raises: