You are currently viewing the Homey Apps SDK v2 documentation. New apps should use Homey Apps SDK v3 ››

Homey.FlowCardCondition

const { FlowCardCondition } = require('homey');

The FlowCardTrigger class is a programmatic representation of a Flow Card with type condition, as defined in an app's app.json.

Table of Contents

Constructor

new Homey.FlowCardCondition(id)

Parameters:
Name Type Description
id string

The ID of the card as defined in the app's app.json.

Extends

Methods

getArgument() → {FlowArgument}

Get an FlowArgument instance.

Overrides:
Returns:
Type:
FlowArgument

getArgumentValues(callbackopt) → {Promise}

Get the current argument values of this card, as filled in by the user.

Overrides:
Parameters:
Name Type Attributes Description
callback function <optional>
Name Type Description
err Error
values Array

An array of key-value objects with the argument's name as key. Every array entry represents one Flow card.

Returns:
Type:
Promise

register() → {FlowCard}

Register the Card. This is a shorthand method for ManagerFlow#registerCard.

Overrides:
Returns:
Type:
FlowCard

registerRunListener(fn) → {FlowCard}

Register a listener for a run event. Return a Promise, or run the callback.

Overrides:
Parameters:
Name Type Description
fn function
Name Type Description
args Object

The arguments of the Flow Card, with keys as defined in the /app.json and values as specified by the user

state Object

The state of the Flow

callback genericCallbackFunction
Returns:
Type:
FlowCard

unregister()

Unregister the Card. This is a shorthand method for ManagerFlow#unregisterCard.

Overrides:

Events

.on('update')

This event is fired when the card is updated by the user (e.g. a Flow has been saved).

Overrides: