2 * Copyright (c) 2010-2021 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;
16 * The {@link BigAssFanDevice} is responsible for storing information about a fan.
18 * @author Mark Hilbush - Initial contribution
20 public class BigAssFanDevice {
22 * Name of device (e.g. Master Bedroom Fan)
27 * IP address of the device extracted from UDP packet
29 private String ipAddress;
32 * MAC address of the device extracted from discovery message
34 private String macAddress;
37 * Type of device extracted from discovery message (e.g. FAN or SWITCH)
42 * Model of device extracted from discovery message (e.g. HSERIES)
47 * The raw discovery message
49 private String discoveryMessage;
51 public String getLabel() {
55 public void setLabel(String label) {
59 public String getIpAddress() {
63 public void setIpAddress(String ipAddress) {
64 this.ipAddress = ipAddress;
67 public String getMacAddress() {
71 public void setMacAddress(String macAddress) {
72 this.macAddress = macAddress;
75 public String getModel() {
79 public void setModel(String model) {
83 public String getType() {
87 public void setType(String type) {
91 public String getDiscoveryMessage() {
92 return discoveryMessage;
95 public void setDiscoveryMessage(String discoveryMessage) {
96 this.discoveryMessage = discoveryMessage;
99 public boolean isFan() {
100 return type.toUpperCase().contains("FAN") ? true : false;
103 public boolean isSwitch() {
104 return type.toUpperCase().contains("SWITCH") ? true : false;
107 public boolean isLight() {
108 return type.toUpperCase().contains("LIGHT") ? true : false;
111 public void reset() {
117 discoveryMessage = "";
121 public String toString() {
122 return "BigAssFanDevice{label=" + label + ", ipAddress=" + ipAddress + ", macAddress=" + macAddress + ", model="
123 + model + ", type=" + type + "}";