]> git.basschouten.com Git - openhab-addons.git/blob
47e187e3ca5be54638270491ca17fab88fafe078
[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.lirc.internal.messages;
14
15 /**
16  * Represents a button event that was received from the LIRC server
17  *
18  * @author Andrew Nagle - Initial contribution
19  */
20 public class LIRCButtonEvent {
21
22     private final String code;
23     private final int repeats;
24     private final String button;
25     private final String remote;
26
27     public LIRCButtonEvent(String remote, String button, int repeats, String code) {
28         this.code = code;
29         this.repeats = repeats;
30         this.button = button;
31         this.remote = remote;
32     }
33
34     /**
35      * Gets the number of times this event was repeated.
36      *
37      * @return number of repeats
38      */
39     public int getRepeats() {
40         return repeats;
41     }
42
43     /**
44      * Gets the name of the button that was pressed
45      *
46      * @return the name of the button
47      */
48     public String getButton() {
49         return button;
50     }
51
52     /**
53      * Gets the name of the remote that generated this event
54      *
55      * @return the name of the remote
56      */
57     public String getRemote() {
58         return remote;
59     }
60
61     /**
62      * Gets the raw hex code of the button pressed
63      *
64      * @return the hex code
65      */
66     public String getCode() {
67         return code;
68     }
69 }