2 * Copyright (c) 2010-2020 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.gardena.internal;
16 import java.util.concurrent.ScheduledExecutorService;
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;
25 * Describes the methods required for the communication with Gardens Smart Home.
27 * @author Gerhard Riegler - Initial contribution
29 public interface GardenaSmart {
32 * Initializes Gardena Smart Home and loads all devices from all locations.
34 public void init(String id, GardenaConfig config, GardenaSmartEventListener eventListener,
35 ScheduledExecutorService scheduler) throws GardenaException;
38 * Disposes Gardena Smart Home.
40 public void dispose();
43 * Loads all devices from all locations.
45 public void loadAllDevices() throws GardenaException;
48 * Returns all locations.
50 public Set<Location> getLocations();
53 * Returns a device with the given id.
55 public Device getDevice(String deviceId) throws GardenaException;
58 * Sends a command to Gardena Smart Home.
60 public void sendCommand(Device device, GardenaSmartCommandName commandName, Object value) throws GardenaException;
63 * Sends a setting to Gardena Smart Home.
65 public void sendSetting(Setting setting, Object value) throws GardenaException;
70 public String getId();