Skip to content

Commit e77915c

Browse files
committed
Call setup() on autonomous modes, fixing #19
1 parent 027b4ef commit e77915c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

magicbot/magicrobot.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,12 @@ def _create_components(self):
498498
if hasattr(component, 'setup'):
499499
component.setup()
500500

501+
# Call setup functions for autonomous modes
502+
for mode in self._automodes.modes.values():
503+
if hasattr(component, 'setup'):
504+
mode.setup()
505+
506+
501507
def _create_component(self, name, ctyp):
502508
# Create instance, set it on self
503509
component = ctyp()

0 commit comments

Comments
 (0)