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.enocean.internal.eep.F6_01;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.enocean.internal.eep.Base._RPSMessage;
18 import org.openhab.binding.enocean.internal.messages.ERP1Message;
19 import org.openhab.core.config.core.Configuration;
20 import org.openhab.core.thing.CommonTriggerEvents;
24 * @author Daniel Weber - Initial contribution
27 public class F6_01_01 extends _RPSMessage {
33 public F6_01_01(ERP1Message packet) {
38 protected @Nullable String convertToEventImpl(String channelId, String channelTypeId, @Nullable String lastEvent,
39 Configuration config) {
40 return getBit(bytes[0], 4) ? CommonTriggerEvents.PRESSED : CommonTriggerEvents.RELEASED;
44 protected boolean validateData(byte[] bytes) {
45 return super.validateData(bytes) && !getBit(bytes[0], 7);
49 public boolean isValidForTeachIn() {
50 // just treat press as teach in, ignore release
51 return t21 && !nu && bytes[0] == 0x10;