From d916f5bc65910db9b1101cd6a373f6b21a83c547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Bokros?= Date: Sun, 3 Dec 2017 23:42:00 +0100 Subject: [PATCH] Give Button states boring names --- src/app/buttons.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/buttons.py b/src/app/buttons.py index 1e84545..4bdffee 100644 --- a/src/app/buttons.py +++ b/src/app/buttons.py @@ -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')