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.bigassfan.internal.discovery;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * The {@link BigAssFanDevice} is responsible for storing information about a fan.
20 * @author Mark Hilbush - Initial contribution
23 public class BigAssFanDevice {
25 * Name of device (e.g. Master Bedroom Fan)
27 private String label = "";
30 * IP address of the device extracted from UDP packet
32 private String ipAddress = "";
35 * MAC address of the device extracted from discovery message
37 private String macAddress = "";
40 * Type of device extracted from discovery message (e.g. FAN or SWITCH)
42 private String type = "";
45 * Model of device extracted from discovery message (e.g. HSERIES)
47 private String model = "";
50 * The raw discovery message
52 private String discoveryMessage = "";
54 public String getLabel() {
58 public void setLabel(String label) {
62 public String getIpAddress() {
66 public void setIpAddress(String ipAddress) {
67 this.ipAddress = ipAddress;
70 public String getMacAddress() {
74 public void setMacAddress(String macAddress) {
75 this.macAddress = macAddress;
78 public String getModel() {
82 public void setModel(String model) {
86 public String getType() {
90 public void setType(String type) {
94 public String getDiscoveryMessage() {
95 return discoveryMessage;
98 public void setDiscoveryMessage(String discoveryMessage) {
99 this.discoveryMessage = discoveryMessage;
102 public boolean isFan() {
103 return type.toUpperCase().contains("FAN") ? true : false;
106 public boolean isSwitch() {
107 return type.toUpperCase().contains("SWITCH") ? true : false;
110 public boolean isLight() {
111 return type.toUpperCase().contains("LIGHT") ? true : false;
114 public void reset() {
120 discoveryMessage = "";
124 public String toString() {
125 return "BigAssFanDevice{label=" + label + ", ipAddress=" + ipAddress + ", macAddress=" + macAddress + ", model="
126 + model + ", type=" + type + "}";