2 * Copyright (c) 2010-2023 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.satel.internal.event;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.satel.internal.types.IntegraType;
19 * Event class describing type and version of connected Integra system.
21 * @author Krzysztof Goworek - Initial contribution
24 public class IntegraVersionEvent implements SatelEvent {
27 private String version;
28 private byte language;
29 private boolean settingsInFlash;
32 * Constructs new event class.
34 * @param type Integra type
35 * @param version string describing version number and firmware revision
36 * @param language firmware language: 1 - english
37 * @param settingsInFlash settings stored in flash memory
39 public IntegraVersionEvent(byte type, String version, byte language, boolean settingsInFlash) {
41 this.version = version;
42 this.language = language;
43 this.settingsInFlash = settingsInFlash;
47 * @return Integra type
50 public byte getType() {
55 * @return firmware version and date
57 public String getVersion() {
62 * @return firmware language
64 public byte getLanguage() {
69 * @return <code>true</code> if configuration is stored in flash memory
71 public boolean getSettingsInflash() {
72 return this.settingsInFlash;
76 public String toString() {
77 return String.format("IntegraVersionEvent: type = %d, version = %s, language = %d, settingsInFlash = %b",
78 this.type & 0xFF, this.version, this.language, this.settingsInFlash);