2 * Copyright (c) 2010-2022 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.shelly.internal.api;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyOtaCheckResult;
19 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyRollerStatus;
20 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsDevice;
21 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsLogin;
22 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellySettingsStatus;
23 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyShortLightStatus;
24 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusLight;
25 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusRelay;
26 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusSensor;
27 import org.openhab.binding.shelly.internal.config.ShellyThingConfiguration;
30 * The {@link ShellyApiInterface} Defines device API
32 * @author Markus Michels - Initial contribution
35 public interface ShellyApiInterface {
36 public boolean isInitialized();
38 public void initialize() throws ShellyApiException;
40 public void setConfig(String thingName, ShellyThingConfiguration config);
42 public ShellySettingsDevice getDeviceInfo() throws ShellyApiException;
44 public ShellyDeviceProfile getDeviceProfile(String thingType) throws ShellyApiException;
46 public ShellySettingsStatus getStatus() throws ShellyApiException;
48 public void setLedStatus(String ledName, Boolean value) throws ShellyApiException;
50 public void setSleepTime(int value) throws ShellyApiException;
52 public ShellyStatusRelay getRelayStatus(int relayIndex) throws ShellyApiException;
54 public void setRelayTurn(int id, String turnMode) throws ShellyApiException;
56 public ShellyRollerStatus getRollerStatus(int rollerIndex) throws ShellyApiException;
58 public void setRollerTurn(int relayIndex, String turnMode) throws ShellyApiException;
60 public void setRollerPos(int relayIndex, int position) throws ShellyApiException;
62 public void setTimer(int index, String timerName, int value) throws ShellyApiException;
64 public ShellyStatusSensor getSensorStatus() throws ShellyApiException;
66 public ShellyStatusLight getLightStatus() throws ShellyApiException;
68 public ShellyShortLightStatus getLightStatus(int index) throws ShellyApiException;
70 public void setLightMode(String mode) throws ShellyApiException;
72 public void setLightParm(int lightIndex, String parm, String value) throws ShellyApiException;
74 public void setLightParms(int lightIndex, Map<String, String> parameters) throws ShellyApiException;
76 public ShellyShortLightStatus setLightTurn(int id, String turnMode) throws ShellyApiException;
78 public void setBrightness(int id, int brightness, boolean autoOn) throws ShellyApiException;
81 public void setValveMode(int id, boolean auto) throws ShellyApiException;
83 public void setValveTemperature(int valveId, int value) throws ShellyApiException;
85 public void setValveProfile(int valveId, int value) throws ShellyApiException;
87 public void setValvePosition(int valveId, double value) throws ShellyApiException;
89 public void setValveBoostTime(int valveId, int value) throws ShellyApiException;
91 public void startValveBoost(int valveId, int value) throws ShellyApiException;
93 public ShellyOtaCheckResult checkForUpdate() throws ShellyApiException;
95 public ShellySettingsLogin getLoginSettings() throws ShellyApiException;
97 public ShellySettingsLogin setLoginCredentials(String user, String password) throws ShellyApiException;
99 public String setWiFiRecovery(boolean enable) throws ShellyApiException;
101 public String deviceReboot() throws ShellyApiException;
103 public String setDebug(boolean enabled) throws ShellyApiException;
105 public String getDebugLog(String id) throws ShellyApiException;
107 public String setCloud(boolean enabled) throws ShellyApiException;
109 public String setApRoaming(boolean enable) throws ShellyApiException;
111 public String factoryReset() throws ShellyApiException;
113 public String resetStaCache() throws ShellyApiException;
115 public int getTimeoutsRecovered();
117 public int getTimeoutErrors();
119 public String getCoIoTDescription() throws ShellyApiException;
121 public ShellySettingsLogin setCoIoTPeer(String peer) throws ShellyApiException;
123 public void setActionURLs() throws ShellyApiException;
125 public void sendIRKey(String keyCode) throws ShellyApiException, IllegalArgumentException;