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): """