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.smartmeter.internal;
15 import javax.measure.Quantity;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
20 * Listener which can be notified whenever new values are read form a meter device.
22 * @author Matthias Steigenberger - Initial contribution
26 public interface MeterValueListener {
29 * Called whenever some (reading-) error occurred.
31 * @param e The Exception that was thrown.
33 public void errorOccurred(Throwable e);
36 * Called whenever some value was added or changed for a meter device.
38 * @param value The changed value.
40 public <Q extends Quantity<Q>> void valueChanged(MeterValue<Q> value);
43 * Called whenever some value was removed from the meter device (not available anymore).
45 * @param value The removed value.
47 public <Q extends Quantity<Q>> void valueRemoved(MeterValue<Q> value);