]> git.basschouten.com Git - openhab-addons.git/blob
4eedaefc889b4483e10c26717bbcd03793ec9ca2
[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.satel.internal.event;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * Event class describing version of communication module.
19  *
20  * @author Krzysztof Goworek - Initial contribution
21  */
22 @NonNullByDefault
23 public class ModuleVersionEvent implements SatelEvent {
24
25     private String version;
26     private boolean extPayloadSupport;
27
28     /**
29      * Constructs new event class.
30      *
31      * @param version string describing version number and firmware revision
32      * @param extPayloadSupport the module supports extended (32-bit) payload for zones/outputs
33      */
34     public ModuleVersionEvent(String version, boolean extPayloadSupport) {
35         this.version = version;
36         this.extPayloadSupport = extPayloadSupport;
37     }
38
39     /**
40      * @return firmware version and date
41      */
42     public String getVersion() {
43         return version;
44     }
45
46     /**
47      * @return <code>true</code> if the module supports extended (32-bit) payload for zones/outputs
48      */
49     public boolean hasExtPayloadSupport() {
50         return this.extPayloadSupport;
51     }
52
53     @Override
54     public String toString() {
55         return String.format("ModuleVersionEvent: version = %s, extPayloadSupport = %b", this.version,
56                 this.extPayloadSupport);
57     }
58 }