Give Button states boring names

This commit is contained in:
Bálint Bokros 2017-12-03 23:42:00 +01:00
parent 23bef68f51
commit d916f5bc65

View File

@ -2,20 +2,19 @@ from transitions import Machine
import event_handler_connector
class Buttons:
states = ['ayy', 'bee', 'cee']
states = ['A', 'B', 'C']
transitions = [
{'trigger': 'anchor_a', 'source': 'ayy', 'dest': 'bee'},
{'trigger': 'anchor_b', 'source': 'bee', 'dest': 'cee'},
{'trigger': 'anchor_c', 'source': 'cee', 'dest': 'ayy'},
{'trigger': 'anchor_a', 'source': 'A', 'dest': 'B'},
{'trigger': 'anchor_b', 'source': 'B', 'dest': 'C'},
{'trigger': 'anchor_c', 'source': 'C', 'dest': 'A'},
]
def __init__(self):
self.machine = Machine(model=self,
states=Buttons.states,
transitions=Buttons.transitions,
initial='ayy',
initial='A',
send_event=True,
ignore_invalid_triggers=True,
after_state_change='forward_message')