def run(self): self.pi_setup() switch_obj = Switch(self, Water_System.push_button) switch_obj.run(Water_System.led) thread1 = threading.Thread(target=self.data_generator.monitor_data, name="thread1", args=(self.lock, ), daemon=True) thread1.start() try: while True: pass except KeyboardInterrupt: return