]> git.basschouten.com Git - openhab-addons.git/blob
e8bda94154d6a63c2e47a118baa390570a1254b0
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.gardena.internal;
14
15 import java.util.Collection;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.gardena.internal.exception.GardenaDeviceNotFoundException;
19 import org.openhab.binding.gardena.internal.exception.GardenaException;
20 import org.openhab.binding.gardena.internal.model.dto.Device;
21 import org.openhab.binding.gardena.internal.model.dto.api.DataItem;
22 import org.openhab.binding.gardena.internal.model.dto.command.GardenaCommand;
23
24 /**
25  * Describes the methods required for the communication with Gardena smart system.
26  *
27  * @author Gerhard Riegler - Initial contribution
28  */
29 @NonNullByDefault
30 public interface GardenaSmart {
31
32     /**
33      * Disposes Gardena smart system.
34      */
35     public void dispose();
36
37     /**
38      * Returns all devices from all locations.
39      */
40     public Collection<Device> getAllDevices();
41
42     /**
43      * Returns a device with the given id.
44      */
45     public Device getDevice(String deviceId) throws GardenaDeviceNotFoundException;
46
47     /**
48      * Sends a command to Gardena smart system.
49      */
50     public void sendCommand(DataItem<?> dataItem, GardenaCommand gardenaCommand) throws GardenaException;
51
52     /**
53      * Returns the id.
54      */
55     public String getId();
56
57     /**
58      * Restarts all WebSocket.
59      */
60     public void restartWebsockets();
61 }