Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DeviceEvent

Contains a communication event to control a Z-Bus Device, such communication is either

  • transmitted to any smart home Device over the Z-Bus network, or
  • received from any smart home Device over the Z-Bus network.

Hierarchy

  • DeviceEvent

Index

Constructors

Properties

Constructors

constructor

  • new DeviceEvent(address: number, command: number | "toggle" | "up-stop" | "down-stop" | "start" | "end" | "on" | "off" | "up" | "down" | "stop", data?: number[]): DeviceEvent
  • Create a DeviceEvent based on address, event, and optionally data

    Example

    { DeviceEvent } = require('@z-bus/api');
    const event = new DeviceEvent(0, 'on'); //Event to switch address 0 on
    

    Parameters

    • address: number
    • command: number | "toggle" | "up-stop" | "down-stop" | "start" | "end" | "on" | "off" | "up" | "down" | "stop"
    • Optional data: number[]

    Returns DeviceEvent

Properties

Readonly address

address: number

Address of the Z-Bus device between 0 and 242

Readonly command

command: number

Command used to control a device between 0 and 255 (values see Command)

Optional Readonly data

data: number[]

Optional two-byte data packet used to control a device (each byte between 0 and 255)

Generated using TypeDoc