2 * Copyright (c) 2010-2024 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.tacmi.internal.schema;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.core.thing.Channel;
18 import org.openhab.core.types.State;
21 * The {@link ApiPageEntry} class contains mapping information for an entry of
24 * @author Christian Niessner - Initial contribution
27 public class ApiPageEntry {
30 READ_ONLY_SWITCH(true),
31 READ_ONLY_NUMERIC(true),
35 READ_ONLY_STATE(true),
38 public final boolean readOnly;
40 private Type(boolean readOnly) {
41 this.readOnly = readOnly;
48 public final Type type;
51 * The channel for this entry
53 public final Channel channel;
56 * internal address for this channel
58 public final @Nullable String address;
61 * data for handle 'changerx2' form fields
63 public final @Nullable ChangerX2Entry changerX2Entry;
66 * The last known state for this item...
68 private State lastState;
71 * Timestamp (epoch ms) when last 'outgoing' command was sent.
72 * Required for de-bounce overlapping effects when status-poll's and updates overlap.
74 private long lastCommandTS;
76 protected ApiPageEntry(final Type type, final Channel channel, @Nullable final String address,
77 @Nullable ChangerX2Entry changerX2Entry, State lastState) {
79 this.channel = channel;
80 this.address = address;
81 this.changerX2Entry = changerX2Entry;
82 this.lastState = lastState;
85 public void setLastState(State lastState) {
86 this.lastState = lastState;
89 public State getLastState() {
93 public long getLastCommandTS() {
97 public void setLastCommandTS(long lastCommandTS) {
98 this.lastCommandTS = lastCommandTS;