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.enocean.internal.eep.A5_30;
15 import static org.openhab.binding.enocean.internal.EnOceanBindingConstants.*;
17 import java.util.function.Function;
19 import org.openhab.binding.enocean.internal.eep.Base._4BSMessage;
20 import org.openhab.binding.enocean.internal.messages.ERP1Message;
21 import org.openhab.core.config.core.Configuration;
22 import org.openhab.core.library.types.QuantityType;
23 import org.openhab.core.library.unit.SIUnits;
24 import org.openhab.core.types.State;
25 import org.openhab.core.types.UnDefType;
29 * @author Daniel Weber - Initial contribution
31 public class A5_30_03 extends _4BSMessage {
33 protected static final byte ALL_DIGITALPINS_HIGH = 0x0F;
34 protected static final byte WAKEUPPIN_HIGH = 0x10;
39 this.supportsTeachInVariation3 = true;
42 public A5_30_03(ERP1Message packet) {
45 this.supportsTeachInVariation3 = true;
49 protected State convertToStateImpl(String channelId, String channelTypeId,
50 Function<String, State> getCurrentStateFunc, Configuration config) {
52 case CHANNEL_TEMPERATURE:
53 double temp = (getDB_2Value() - 255) / -6.375;
54 return new QuantityType<>(temp, SIUnits.CELSIUS);
57 return UnDefType.UNDEF;