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.digiplex.internal.communication.events;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.digiplex.internal.communication.DigiplexResponse;
19 * Common ancestor for all events received from Digiplex system
21 * @author Robert Michalak - Initial contribution
25 public abstract class AbstractEvent implements DigiplexResponse {
29 public AbstractEvent(int areaNo) {
33 public int getAreaNo() {
37 public boolean isForArea(int areaNo) {
38 if (this.areaNo == 0 || this.areaNo == areaNo) {
41 // TODO: According to documentation: areaNo = 255 - Occurs in at least one area enabled in the system.
42 // I did never encounter 255 on my system though (EVO192).
43 // 15 is returned instead, which (I believe) has the same meaning.
44 return (this.areaNo == 15 || this.areaNo == 255);