From 19851ed423733e90f4e71f8c585fcf3b1b537b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Sat, 22 Apr 2017 21:38:02 +0200 Subject: [PATCH] bug fix in timeout (#70) --- broadlink/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/broadlink/__init__.py b/broadlink/__init__.py index 495e07c..f875f5b 100644 --- a/broadlink/__init__.py +++ b/broadlink/__init__.py @@ -274,9 +274,8 @@ class device: response = self.cs.recvfrom(1024) break except socket.timeout: - if (time.time() - starttime) < self.timeout: - pass - raise + if (time.time() - starttime) > self.timeout: + raise return bytearray(response[0])