]> git.basschouten.com Git - openhab-addons.git/blob
8ef4d7845002d1ef8742fd7024c3222f4b345ce5
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.salus.internal.handler;
14
15 import java.util.Optional;
16 import java.util.SortedSet;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.openhab.binding.salus.internal.rest.Device;
20 import org.openhab.binding.salus.internal.rest.DeviceProperty;
21 import org.openhab.binding.salus.internal.rest.SalusApiException;
22
23 /**
24  * @author Martin GrzeĊ›lowski - Initial contribution
25  */
26 @NonNullByDefault
27 public interface CloudApi {
28     /**
29      * Finds all devices from cloud
30      * 
31      * @return all devices from cloud
32      */
33     SortedSet<Device> findDevices() throws SalusApiException;
34
35     /**
36      * Find a device by DSN
37      * 
38      * @param dsn of the device to find
39      * @return a device with given DSN (or empty if no found)
40      */
41     Optional<Device> findDevice(String dsn) throws SalusApiException;
42
43     /**
44      * Sets value for a property
45      * 
46      * @param dsn of the device
47      * @param propertyName property name
48      * @param value value to set
49      * @return if value was properly set
50      */
51     boolean setValueForProperty(String dsn, String propertyName, Object value) throws SalusApiException;
52
53     /**
54      * Finds all properties for a device
55      * 
56      * @param dsn of the device
57      * @return all properties of the device
58      */
59     SortedSet<DeviceProperty<?>> findPropertiesForDevice(String dsn) throws SalusApiException;
60 }