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.hue.internal.handler;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.hue.internal.dto.FullSensor;
19 * The {@link SensorStatusListener} is notified when a sensor status has changed or a sensor has been removed or added.
21 * @author Samuel Leisering - Initial contribution
22 * @author Christoph Weitkamp - Initial contribution
25 public interface SensorStatusListener {
28 * This method returns the sensor Id
30 * @return sensor id of thing or DISCOVERY for discovery service
35 * This method is called whenever the state of the given sensor has changed. The new state can be obtained by
36 * {@link FullSensor#getState()}.
38 * @param sensor The sensor which received the state update.
39 * @return The sensor handler returns true if it accepts the new state.
41 boolean onSensorStateChanged(FullSensor sensor);
44 * This method is called whenever a sensor is removed.
46 void onSensorRemoved();
49 * This method is called whenever a sensor is reported as gone.
54 * This method is called whenever a sensor is added.
56 * @param sensor The added sensor
58 void onSensorAdded(FullSensor sensor);