def data_received(self, data):
<EOL>self._buffer += data<EOL>log_binary(_LOGGER, '<STR_LIT>', Data=data)<EOL>while self._buffer:<EOL><INDENT>length, raw = read_variant(self._buffer)<EOL>if len(raw) < length:<EOL><INDENT>_LOGGER.debug(<EOL>'<STR_LIT>', length, len(raw))<EOL>break<EOL><DEDENT>data = raw[:length]  <EOL>self._buffer = raw[length:]  <EOL>try:<EOL><INDENT>self._handle_message(data)<EOL><DEDENT>except Exception:  <EOL><INDENT>_LOGGER.error('<STR_LIT>')<EOL><DEDENT><DEDENT>
Message was received from device.