Homey Community Forum

H.O.O.P. (Hope) - Flow Variables - In-Line flow variables

Flow Variables

Part of: H.O.O.P. (Hope) - Homey Object Oriented Programming

Summary

This device offers flow condition cards to handle variables synchronised within the flow.
It allows for expressions with methods you can create yourself in the settings.
The expression gets sandboxed in a VM with all options of the V8 Javascript Engine.
So you can use Math.floor and a lott more!
This is very handy for working with arrays, and you want to fiddle with it.
Setting vairable type to Json makes sure you can use quote’s within array’s without messing it up later when retrieving it.

Variables are put down as flowtokens. If you use these flowcards within flows triggered by H.O.O.P., the variables are scoped(!) so simultaneous execution is possible within H.O.O.P.

Flow cards

Conditions

  • Set [[type]] [[name]] to [[expression]]
    This conditioncard lets you create and set a variable instantly with a expression.

Settings

Functions
image

random Function
image

Examples

Example Array

Example Number

image