2 * Copyright (c) 2010-2023 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.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.dmx.internal.multiverse.DmxChannel;
19 * The {@link BaseAction} is the base class for Actions like faders, chasers, etc..
21 * @author Davy Vanherbergen - Initial contribution
22 * @author Jan N. Klug - Refactoring for ESH
25 public abstract class BaseAction {
27 protected ActionState state = ActionState.WAITING;
28 protected long startTime = 0;
31 * Calculate the new output value of the channel.
34 * @param currentTime UNIX timestamp to use as current time
35 * @return value as float between 0 - 65535
37 public abstract int getNewValue(DmxChannel channel, long currentTime);
40 * @return the action's state
42 public final ActionState getState() {
47 * Reset the action to start from the beginning.
51 state = ActionState.WAITING;