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.homematic.internal.communicator.virtual;
15 import java.io.IOException;
17 import org.openhab.binding.homematic.internal.misc.HomematicClientException;
18 import org.openhab.binding.homematic.internal.model.HmChannel;
19 import org.openhab.binding.homematic.internal.model.HmDatapoint;
20 import org.openhab.binding.homematic.internal.model.HmDatapointConfig;
21 import org.openhab.binding.homematic.internal.model.HmDevice;
24 * Describes the methods used for a virtual datapoint. A virtual datapoint is generated datapoint with special
27 * @author Gerhard Riegler - Initial contribution
29 public interface VirtualDatapointHandler {
32 * Returns the virtual datapoint name.
37 * Adds the virtual datapoint to the device.
39 void initialize(HmDevice device);
42 * Returns true, if the virtual datapoint can handle a command for the given datapoint.
44 boolean canHandleCommand(HmDatapoint dp, Object value);
47 * Handles the special functionality for the given virtual datapoint.
49 void handleCommand(VirtualGateway gateway, HmDatapoint dp, HmDatapointConfig dpConfig, Object value)
50 throws IOException, HomematicClientException;
53 * Returns true, if the virtual datapoint can handle the event for the given datapoint.
55 boolean canHandleEvent(HmDatapoint dp);
58 * Handles an event to extract data required for the virtual datapoint.
60 void handleEvent(VirtualGateway gateway, HmDatapoint dp);
63 * Returns the virtual datapoint in the given channel.
65 HmDatapoint getVirtualDatapoint(HmChannel channel);