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.openhab.binding.enocean.internal.eep.Base._RPSMessage;
16 import org.openhab.binding.enocean.internal.messages.ERP1Message;
17 import org.openhab.core.config.core.Configuration;
18 import org.openhab.core.thing.CommonTriggerEvents;
22 * @author Daniel Weber - Initial contribution
24 public class F6_01_01 extends _RPSMessage {
30 public F6_01_01(ERP1Message packet) {
35 protected String convertToEventImpl(String channelId, String channelTypeId, String lastEvent,
36 Configuration config) {
38 return getBit(bytes[0], 4) ? CommonTriggerEvents.PRESSED : CommonTriggerEvents.RELEASED;
42 protected boolean validateData(byte[] bytes) {
43 return super.validateData(bytes) && !getBit(bytes[0], 7);
47 public boolean isValidForTeachIn() {
48 // just treat press as teach in, ignore release
49 return t21 && !nu && bytes[0] == 0x10;