From 5244e91fb846ef2412ae0d21fe61ae10c8dd4f56 Mon Sep 17 00:00:00 2001 From: Scott Petersen Date: Tue, 10 Jan 2017 10:57:39 -0800 Subject: [PATCH] Another 2to3 workaround. --- alarmdecoder/decoder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/alarmdecoder/decoder.py b/alarmdecoder/decoder.py index 057fb49..523d301 100644 --- a/alarmdecoder/decoder.py +++ b/alarmdecoder/decoder.py @@ -248,7 +248,9 @@ class AlarmDecoder(object): """ if self._device: - self._device.write(str.encode(data)) + if isinstance(data, str): + data = str.encode(data) + self._device.write(data) def get_config(self): """