// Available variables: // - Machine // - interpret // - assign // - send // - sendParent // - spawn // - raise // - actions // - XState (all XState exports) const gpioMachine = Machine({ "id": "hydrogel", "initial": "Inactive", "states": { "Inactive": { "activities": [ { "type": "beep", "id": "inactive" } ], "on": { "PRESENCE": { "target": "Active", "actions": [ "notify"] } }, "initial": "InactiveLocked", "states": { "InactiveLocked": { "on": { "PRESENCE": "InactiveLocked", "INACTIVE_LOCKED_DELAY": "InactiveUnlocked" } }, "InactiveUnlocked": { "activities": [ "beep" ] } } }, "Active": { "activities": [ { "type": "gpio", "id": "active-inactive" } ], "on": { "ABSENCE": "Inactive", "ACTIVE_DELAY": "Inactive" } } } });