Filter DeviceEvents emitted by the source Observable by only this address and/or event
const { receive } = require('@z-bus/api/operators');
zBus.reception.pipe(receive(80)).subscribe((event) => {
console.log('Received', event.event, 'on address 80');
});
If an emitted DeviceEvent matches this address (or one of these addresses), it is passed on, and filtered otherwise
If an emitted DeviceEvent matches this event (or one of these commands), it is passed on, and filtered otherwise
Perform a side transmission for every emission on the source DeviceEvent, but return an DeviceEvent that is identical to the source.
This implements an automatic staircase timer by using receive, transmit
, and the RxJS debounceTime operator.
const { receive, transmit } = require('@z-bus/api/operators');
const { debounceTime } = require('rxjs/operators');
zBus.reception
.pipe(
receive(99), // when 99 is triggered
transmit(99, 'on'), // then switch 99 on
debounceTime(3 * 60 * 1000), // debounce for 3 minutes
transmit(99, 'off') // and switch 99 off (after 3 minutes of silence)
)
.subscribe();
One or more addresses of the controlled Device(s) between 0
and 242
Valid Command (name or number
between 0
and 255
) to send to the device
An optional two-bytes data packet.
Generated using TypeDoc
RxJS operators.
This module defines RxJS operators specific for Z-Bus usage.