Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DeviceEventNotification

This notifies the caller about incoming Z-Bus communication as used in ZBus.receive

Example

Anonymous callback:

zBus.receive((event) => {
    console.log('Received', event.address, event.event, event.data);
});

Callback with a named function:

function forwardCommand(event) {
    zBus.transmit([0, 1, 2, 3, 4, 5, 6, 7, 8], event.event);
}
zBus.receive(99, ['on', 'off'], forwardCommand);

Callback skipping the event parameter:

zBus.receive(() => {
    console.log('Something received');
});

Hierarchy

  • DeviceEventNotification

Callable

  • This notifies the caller about incoming Z-Bus communication as used in ZBus.receive

    Example

    Anonymous callback:

    zBus.receive((event) => {
        console.log('Received', event.address, event.event, event.data);
    });
    

    Callback with a named function:

    function forwardCommand(event) {
        zBus.transmit([0, 1, 2, 3, 4, 5, 6, 7, 8], event.event);
    }
    zBus.receive(99, ['on', 'off'], forwardCommand);
    

    Callback skipping the event parameter:

    zBus.receive(() => {
        console.log('Something received');
    });
    

    Parameters

    Returns void

Generated using TypeDoc