2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.dmx.internal.action;
15 import org.openhab.binding.dmx.internal.multiverse.DmxChannel;
18 * The {@link BaseAction} is the base class for Actions like faders, chasers, etc..
20 * @author Davy Vanherbergen - Initial contribution
21 * @author Jan N. Klug - Refactoring for ESH
23 public abstract class BaseAction {
25 protected ActionState state = ActionState.WAITING;
26 protected long startTime = 0;
29 * Calculate the new output value of the channel.
32 * @param currentTime UNIX timestamp to use as current time
33 * @return value as float between 0 - 65535
35 public abstract int getNewValue(DmxChannel channel, long currentTime);
38 * @return the action's state
40 public final ActionState getState() {
45 * Reset the action to start from the beginning.
49 state = ActionState.WAITING;