diff --git a/dsmr_parser/clients/serial_.py b/dsmr_parser/clients/serial_.py index 1d7be89..9939194 100644 --- a/dsmr_parser/clients/serial_.py +++ b/dsmr_parser/clients/serial_.py @@ -30,7 +30,7 @@ class SerialReader(object): """ with serial.Serial(**self.serial_settings) as serial_handle: while True: - data = serial_handle.readline() + data = serial_handle.read(max(1, min(1024, serial_handle.in_waiting))) self.telegram_buffer.append(data.decode('ascii')) for telegram in self.telegram_buffer.get_all():