def resendImageData(self):
    for part in self.imageBuffer:
        image = part['image']
        x = part['x']
        y = part['y']
        (w, h) = image.size
        data = image.convert('1').rotate(180).tobytes()
        self.sendToDevice(((((((((CommandCode.DISPLAY.value + ' ') + str(x)) + ' ') + str(y)) + ' ') + str(w)) + ' ') + str(h)))
        self.sendBinaryToDevice(data)
    self.imageBuffer = []
def resendImageData(self):
    for part in self.imageBuffer:
        image = part['image']
        x = part['x']
        y = part['y']
        (w, h) = image.size
        data = image.convert('1').rotate(180).tobytes()
        self.sendToDevice(((((((((CommandCode.DISPLAY.value + ' ') + str(x)) + ' ') + str(y)) + ' ') + str(w)) + ' ') + str(h)))
        self.sendBinaryToDevice(data)
    self.imageBuffer = []