View Source Statux.Transitions (Statux v0.1.4)
Handles evaluation and execution of a Transition from one to another or the same status.
Link to this section Summary
Functions
Pass in an entity state, a list of options and the name of the status
Link to this section Functions
Pass in an entity state, a list of options and the name of the status
iex> maybe_transition(entity_state, :battery_voltage, [:low])
updated_entity_state
to check constraints for the given status_name and options and, if the constraints are fulfilled, alter the entity_state to the new status.
As a side effect, this function may
- broadcast PubSub messages, if PubSub is configured, and/or
- trigger the callback functions provided in the rule set for :enter, :stay, :exit (to be implemented)
You may use these side effects to react to updates in your application.