Class motion.Motion
Base class for all motion controllers. This sets up the basic
repeating timer code, with a callback specified by base classes. Generally
intended as an abstract base class, but could be useful on its own with a
specialized callback. The core methods available for all controllers are
also defined here.
Defined in: motion.em.
Constructor Attributes | Constructor Name and Description |
---|---|
motion.Motion(presence, fn, period)
|
Field Attributes | Field Name and Description |
---|---|
The presence the motion controller controls.
|
Method Attributes | Method Name and Description |
---|---|
reset()
Restarts the controller, resuming if suspended.
|
|
suspend()
Pauses the operation of the controller.
|
Class Detail
motion.Motion(presence, fn, period)
- Parameters:
- {presence} presence
- The presence to control. This may be changed
later by assigning to
controller.presence
. - {function(presence)->undefined} fn
- The callback function to call repeatedly, with the presence as a parameter
- {number} period
- (optional =defaultPeriod) The period at which the callback is called
Field Detail
{presence}
presence
The presence the motion controller controls.
Method Detail
{boolean}
isSuspended()
- Returns:
- {boolean}
true
if the controller is currently suspended,false
otherwise.
reset()
Restarts the controller, resuming if suspended.
suspend()
Pauses the operation of the controller. The controller can be resumed
at any time by calling
reset
.