2 * Copyright (c) 2010-2020 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.rfxcom.internal.messages;
15 import static org.junit.jupiter.api.Assertions.*;
16 import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.HOME_CONFORT;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.junit.jupiter.api.Test;
20 import org.openhab.binding.rfxcom.internal.exceptions.RFXComException;
21 import org.openhab.binding.rfxcom.internal.messages.RFXComHomeConfortMessage.Commands;
22 import org.openhab.binding.rfxcom.internal.messages.RFXComHomeConfortMessage.SubType;
23 import org.openhab.core.util.HexUtils;
26 * Test for RFXCom-binding
28 * @author Martin van Wingerden - Initial contribution
29 * @author Mike Jagdis - added message handling and real test
32 public class RFXComHomeConfortTest {
33 private void testMessage(SubType subType, Commands command, String deviceId, String data) throws RFXComException {
34 RFXComHomeConfortMessage message = (RFXComHomeConfortMessage) RFXComMessageFactory.createMessage(HOME_CONFORT);
35 message.setSubType(subType);
36 message.command = command;
37 message.setDeviceId(deviceId);
39 assertArrayEquals(HexUtils.hexToBytes(data), message.decodeMessage());
43 public void testMessage1() throws RFXComException {
44 testMessage(SubType.TEL_010, Commands.GROUP_ON, "1118739.A.4", "0C1B0000111213410403000000");