Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DimmerData

This packs and unpacks data of a DeviceEvent to control a DimmerDevice

Hierarchy

  • DimmerData

Index

Constructors

Properties

Methods

Constructors

constructor

  • new DimmerData(brightness: number, duration?: number, direction?: number): DimmerData
  • Creates DimmerData properties from brightness, duration and direction

    Example

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

    Parameters

    • brightness: number

      Brightness of the Z-Bus DimmerDevice between 0.0 and 1.0 in %

    • duration: number = 8

      Duration of a full dimming ramp (from 0 to 100%) between 0.04 and 160 seconds

    • direction: number = 0

      Direction of the previous dimming ramp where 0 is down and 1 is up

    Returns DimmerData

Properties

Readonly brightness

brightness: number

Brightness of the Z-Bus DimmerDevice between 0.0 and 1.0 in %

  • 0.0 is off
  • 0.5 is 50% brightness
  • 1.0 is 100% on

Readonly direction

direction: number

Direction of the previous dimming ramp where 0 is down and 1 is up

Readonly duration

duration: number

Duration of a full dimming ramp (from 0 to 100%) between 0.04 and 160 seconds

Methods

Static pack

Static unpack

Generated using TypeDoc