2 * Copyright (c) 2010-2024 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.salus.internal.handler;
15 import java.util.Optional;
16 import java.util.SortedSet;
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;
24 * @author Martin GrzeĊlowski - Initial contribution
27 public interface CloudApi {
29 * Finds all devices from cloud
31 * @return all devices from cloud
33 SortedSet<Device> findDevices() throws SalusApiException;
36 * Find a device by DSN
38 * @param dsn of the device to find
39 * @return a device with given DSN (or empty if no found)
41 Optional<Device> findDevice(String dsn) throws SalusApiException;
44 * Sets value for a property
46 * @param dsn of the device
47 * @param propertyName property name
48 * @param value value to set
49 * @return if value was properly set
51 boolean setValueForProperty(String dsn, String propertyName, Object value) throws SalusApiException;
54 * Finds all properties for a device
56 * @param dsn of the device
57 * @return all properties of the device
59 SortedSet<DeviceProperty<?>> findPropertiesForDevice(String dsn) throws SalusApiException;