__init__ def __init__(self, names, durations=[0, 1, None, 1, 1]) names is a list of state names E.g. ['off', 'opening', 'open', 'closing', 'closed', ] e.g. 2: ['off', 'locking', 'locked', 'unlocking', 'unlocked', ] e.g. 3: ['off', 'deactivating', 'deactive', 'activating', 'activated', ] durations is a list of durations in seconds or None values. The list of duration values should be the same length as the list of state names and the lists correspond. For each state, after n seconds, the ClassicFSM will move to the next state. That does not happen for any duration values of None. More Details Here is a diagram showing the where the names from the list are used: +---------+ | 0 (off) |----> (any other state and vice versa). +---------+ +--------+ -->| 4 (on) |--- | +--------+ | | | | v +---------+ +---------+ | 3 (off) |<----->| 1 (off) | +---------+ +---------+ ^ | | | | +---------+ | --| 2 (off) |<-- +---------+ Each states also has an associated on or off value. The only state that is 'on' is state 4. So, the transition states between off and on (states 1 and 3) are also considered off (and so is state 2 which is oposite of state 4 and therefore oposite of 'on'). |
changedOnState def changedOnState(self, isOn) Allow derived classes to overide this. The self.isOn value has toggled. Call getIsOn() to get the current state. |
delete def delete(self) Undocumented function. |
distributeStateChange def distributeStateChange(self) This function is intentionaly simple so that derived classes may easily alter the network message. |
enterState0 def enterState0(self) Undocumented function. |
enterState1 def enterState1(self) Undocumented function. |
enterState2 def enterState2(self) Undocumented function. |
enterState3 def enterState3(self) Undocumented function. |
enterState4 def enterState4(self) Undocumented function. |
enterStateN def enterStateN(self, stateIndex, nextStateIndex) Undocumented function. |
exitState0 def exitState0(self) Undocumented function. |
exitState1 def exitState1(self) Undocumented function. |
exitState2 def exitState2(self) Undocumented function. |
exitState3 def exitState3(self) Undocumented function. |
exitState4 def exitState4(self) Undocumented function. |
exitStateN def exitStateN(self) Undocumented function. |
getState def getState(self) Undocumented function. |
isOn def isOn(self) Undocumented function. |
sendState def sendState(self) Undocumented function. |
setIsOn def setIsOn(self, isOn) Undocumented function. |
switchToNextStateTask def switchToNextStateTask(self, task) Undocumented function. |