def midden_pressed(self):
        print("midden pressed")
        # niets confirmen op status pagina / als je al aan het wassen bent
        if self.state == "cycling":
            if self.page > 0:
                self.state = "confirm_selection"
                self.confirm_selection()  # toont programma details
            else:
                if not self.hatch:
                    self.open_hatch()
                else:
                    self.close_hatch()

        elif self.state == "confirm_selection":
            self.state = "confirm_mand"
            self.query_mand()

        elif self.state == "confirm_mand":
            self.state = "query_start_time"
            self.query_start_time()

        elif self.state == "query_start_time":
            # was schedulen en in de database steken
            volgnummer = DataRepository.start_washing(
                self.programmas[self.page - 1].get('Id', 0),
                self.mand,
                (datetime.datetime.now() +
                 datetime.timedelta(minutes=self.uitstel_start)),
            )

            self.update_baskets()

            if self.uitstel_start == 0:
                # Direct starten (3 seconden wachten zodat gebruiker hand kan wegdoen)
                DataRepository.commence_washing(volgnummer)
                time.sleep(3)
                LCDController.drop_into_machine(self.mand)

        elif self.state == "asked_to_cancel":
            self.state = "confirm_cancellation"
            self.ask_cancellation_confirmation()

        elif self.state == "confirm_cancellation":
            DataRepository.cancel_was(
                self.baskets['currentlyWashing']['Volgnummer'])
            self.update_baskets()

        elif self.state == "welcome":
            self.update_baskets()
def was(volgnummer, mandId):
    print("Starting to wash")
    drop_into_machine(mandId)
    time.sleep(2)
    DataRepository.commence_washing(volgnummer)