Skip to content
Jon Hall edited this page May 22, 2018 · 2 revisions

Description

Step resources contain data that allows CraftBeerPi to execute an ordered series of steps in an automated fashion.

Methods

Method Param Return Type Description
getStepTypes n/a Promise Fetches a list of all available Step types/properties.
getSteps n/a Promise Fetches a list of all available Step resources.
clearStep n/a Promise Clears all configured steps from CBPi memory.
createStep Step Promise Creates a Step with the given values.
nextStep n/a Promise Start the step order.
startStep n/a Promise Start the current step's timer.
startSteps n/a Promise Start the step order.
reorderSteps Array Promise Reorder the configured steps, based on a given complete ordered list of all steps.
resetStep n/a Promise Reset the currently running step.
resetSteps n/a Promise Stop and reset the step order.
restartSteps n/a Promise Stop and reset the step order, then start the step order again.
onUpdate Function Unsubscribe function A way to register for updates to any of the instances of a Step.

Step Resource

This is the collection of settings that represent a Step resource. Below is the best estimation of what a Step's settings do, in some instances their uses are opaque even to Swill.

Property Type Value Range Description
config Object n/a An object of configurable properties based on the Step type.
end Timestamp * The timestamp when the step ended. Before the step ends, the value is null.
id Number Not Editable The unique identifier for the Step.
name String * The label for the Step.
order Number * The Step order number.
start Timestamp * The timestamp when the step started. Before the step starts, the value is null.
state String I|A|D The step state, I = Incomplete/Not started, A = In progress, D = Done/Complete.
stepstate Object n/a Based on the config, the current step state. Before the step starts, the value is null.
type String Step name The type of step.

For information on basic usage of resource instances, go to Interacting with Resources.

Types

Each Step type has a list of properties and list of actions associated with it. You will want to call getStepTypes to get more advanced configuration information on how to setup a step of a given type.

Note: the full type objects returned from the SDK contain more configuration than is visible in the following table.

Type Config Properties
BoilStep { kettle: KettleId, temp: Degrees, timer: Minutes, ... }
ChilStep { timer: Minutes, ... }
MashInStep { kettle: KettleId, temp: Degrees, ... }
MashStep { kettle: KettleId, temp: Degrees, timer: Minutes, ... }
PumpStep { pump: PumpId, timer: Minutes, ... }

Events

You can subscribe to all Kettle events using the onUpdate function.

Possible Kettle events:

  • UPDATE_STEP
  • UPDATE_ALL_STEPS
  • DELETE_STEP

For more information on how to receive and act on these events, go to Receiving Updates to Instances of Resources.

Clone this wiki locally