Skip to content

Make it optional to preserve old state on animation method #2

@Fensterbank

Description

@Fensterbank

When an animation (e.g. by using a configured animationPreset or by calling the POST method directly) is started, the old state is preserved and reset at the end of the animation

  const old = dmx.universeToObject(req.params.universe);
  [...]
  animation.add(old, 0);

See https://github.com/node-dmx/dmx-web/blob/master/dmx-web.js#L89

By preserving the old state the animation API cannot be used for fading light in and out.
There should be a parameter to define if the old state should be preserved and preserving the old state should be false by default, since simple animations like

[
  {
    "to": {"1":255,"2":255,"3":255,"4":255},
    "duration":1000
  }
]

feel broken.

While it may be a breaking change, I think preserving the old state is not logical.
If the API can be used to set specific channels by using a specific duration, the user does not understand, why it goes back to the previous state after the animation is finished.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions