]> git.basschouten.com Git - openhab-addons.git/blob
9bc6288665282eff849697fd3319a137eaf7d055
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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.Set;
16 import java.util.concurrent.ScheduledExecutorService;
17
18 import org.openhab.binding.gardena.internal.config.GardenaConfig;
19 import org.openhab.binding.gardena.internal.exception.GardenaException;
20 import org.openhab.binding.gardena.internal.model.Device;
21 import org.openhab.binding.gardena.internal.model.Location;
22 import org.openhab.binding.gardena.internal.model.Setting;
23
24 /**
25  * Describes the methods required for the communication with Gardens Smart Home.
26  *
27  * @author Gerhard Riegler - Initial contribution
28  */
29 public interface GardenaSmart {
30
31     /**
32      * Initializes Gardena Smart Home and loads all devices from all locations.
33      */
34     public void init(String id, GardenaConfig config, GardenaSmartEventListener eventListener,
35             ScheduledExecutorService scheduler) throws GardenaException;
36
37     /**
38      * Disposes Gardena Smart Home.
39      */
40     public void dispose();
41
42     /**
43      * Loads all devices from all locations.
44      */
45     public void loadAllDevices() throws GardenaException;
46
47     /**
48      * Returns all locations.
49      */
50     public Set<Location> getLocations();
51
52     /**
53      * Returns a device with the given id.
54      */
55     public Device getDevice(String deviceId) throws GardenaException;
56
57     /**
58      * Sends a command to Gardena Smart Home.
59      */
60     public void sendCommand(Device device, GardenaSmartCommandName commandName, Object value) throws GardenaException;
61
62     /**
63      * Sends a setting to Gardena Smart Home.
64      */
65     public void sendSetting(Setting setting, Object value) throws GardenaException;
66
67     /**
68      * Returns the id.
69      */
70     public String getId();
71 }