]> git.basschouten.com Git - openhab-addons.git/blob
534ddc0bc1426a207a1eb58a7ba70a3b50060128
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.velbus.internal.packets;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.velbus.internal.VelbusChannelIdentifier;
17
18 /**
19  * The {@link VelbusBlindUpDownPacket} represents a Velbus packet that can be used to
20  * move a blind up or down.
21  *
22  * @author Cedric Boon - Initial contribution
23  */
24 @NonNullByDefault
25 public class VelbusBlindUpDownPacket extends VelbusPacket {
26     private final byte timeoutHighByte = 0x00;
27     private final byte timeoutMidByte = 0x00;
28     private final byte timeoutLowByte = 0x00;
29
30     private byte command;
31     private byte channel;
32
33     public VelbusBlindUpDownPacket(VelbusChannelIdentifier velbusChannelIdentifier, byte command) {
34         super(velbusChannelIdentifier.getAddress(), PRIO_HI);
35
36         this.channel = velbusChannelIdentifier.getChannelByte();
37         this.command = command;
38     }
39
40     @Override
41     protected byte[] getDataBytes() {
42         return new byte[] { command, channel, timeoutHighByte, timeoutMidByte, timeoutLowByte };
43     }
44 }