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.io.imperihome.internal.model.device;
15 import org.openhab.core.items.Item;
16 import org.openhab.io.imperihome.internal.model.param.NumericValueParam;
19 * Parent of devices with a {@link NumericValueParam}. Contains the value unit.
21 * @author Pepijn de Geus - Initial contribution
23 public abstract class AbstractNumericValueDevice extends AbstractDevice {
25 private transient String unit;
27 public AbstractNumericValueDevice(DeviceType type, Item item, String defaultUnit) {
29 this.unit = defaultUnit;
32 public String getUnit() {
36 public void setUnit(String unit) {
41 public String toString() {
42 return getClass().getSimpleName() + "{" + "super=" + super.toString() + ", unit='" + unit + '\'' + '}';