Class Scene

The scene object contains the ID, name and a list of products that are contained in the scene. You have methods to start and stop a scene.

Scene

Hierarchy (view full)

Constructors

  • Creates an instance of Scene.

    Parameters

    • Connection: IConnection

      The connection that will be used to send and receive commands.

    • SceneID: number

      The ID of the scene.

    • SceneName: string

      The name of the scene.

    Returns Scene

Properties

Connection: IConnection

The connection that will be used to send and receive commands.

Products: SceneInformationEntry[] = []

Contains a list of node IDs with their target values.

SceneID: number

The ID of the scene.

propertyChangedEvent: TypedEvent<PropertyChangedEvent> = ...

The event will be emitted when any of the public properties has changed. The event object contains a reference to the product, the name of the property that has changed and the new value of that property.

Accessors

  • get IsRunning(): boolean
  • Set to true if the scene is currently running.

    Returns boolean

  • get SceneName(): string
  • The name of the scene.

    Returns string

Methods

  • Protected

    This method emits the property changed event for the provided property name.

    Parameters

    • propertyName: keyof Scene

      Name of the property that has changed.

    Returns Promise<void>

  • Refreshes the Products array.

    This method is called from the Scenes class if a change notification has been received.

    Returns Promise<void>

  • Start the scene.

    Parameters

    • Velocity: Velocity = 0

      The velocity with which the scene will be run.

    • PriorityLevel: PriorityLevel = 3

      The priority level for the run command.

    • CommandOriginator: CommandOriginator = 1

      The command originator for the run command.

    Returns Promise<number>

    Returns the session ID. You can listen for the GW_SESSION_FINISHED_NTF notification to determine when the scene has finished.

  • Stops a running scene.

    Parameters

    • PriorityLevel: PriorityLevel = 3

      The priority level for the run command.

    • CommandOriginator: CommandOriginator = 1

      The command originator for the run command.

    Returns Promise<number>

    Returns the session ID.