Fix failure on commands ending on whitespace #75

Open
esavkin wants to merge 3 commits from esavkin/thermostat:63-fix-pid-error into master
1 changed files with 1 additions and 1 deletions
Showing only changes of commit 211e0fa1bd - Show all commits

View File

@ -23,7 +23,7 @@ class Client:
return line
def _command(self, *command):
self._socket.sendall((" ".join(command) + "\n").encode('utf-8'))
self._socket.sendall(((" ".join(command)).strip() + "\n").encode('utf-8'))
Outdated
Review

If the firmware accepts whitespace at the end this is unnecessary. Remove.

If the firmware accepts whitespace at the end this is unnecessary. Remove.
line = self._read_line()
response = json.loads(line)