2 * Copyright (c) 2010-2023 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.ShellySettingsUpdate;
24 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyShortLightStatus;
25 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusLight;
26 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusRelay;
27 import org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO.ShellyStatusSensor;
28 import org.openhab.binding.shelly.internal.config.ShellyThingConfiguration;
31 * The {@link ShellyApiInterface} Defines device API
33 * @author Markus Michels - Initial contribution
36 public interface ShellyApiInterface {
37 public boolean isInitialized();
39 public void initialize() throws ShellyApiException;
41 public void setConfig(String thingName, ShellyThingConfiguration config);
43 public ShellySettingsDevice getDeviceInfo() throws ShellyApiException;
45 public ShellyDeviceProfile getDeviceProfile(String thingType) throws ShellyApiException;
47 public ShellySettingsStatus getStatus() throws ShellyApiException;
49 public void setLedStatus(String ledName, Boolean value) throws ShellyApiException;
51 public void setSleepTime(int value) throws ShellyApiException;
53 public ShellyStatusRelay getRelayStatus(int relayIndex) throws ShellyApiException;
55 public void setRelayTurn(int id, String turnMode) throws ShellyApiException;
57 public ShellyRollerStatus getRollerStatus(int rollerIndex) throws ShellyApiException;
59 public void setRollerTurn(int relayIndex, String turnMode) throws ShellyApiException;
61 public void setRollerPos(int relayIndex, int position) throws ShellyApiException;
63 public void setAutoTimer(int index, String timerName, double value) throws ShellyApiException;
65 public ShellyStatusSensor getSensorStatus() throws ShellyApiException;
67 public ShellyStatusLight getLightStatus() throws ShellyApiException;
69 public ShellyShortLightStatus getLightStatus(int index) throws ShellyApiException;
71 public void setLightMode(String mode) throws ShellyApiException;
73 public void setLightParm(int lightIndex, String parm, String value) throws ShellyApiException;
75 public void setLightParms(int lightIndex, Map<String, String> parameters) throws ShellyApiException;
77 public ShellyShortLightStatus setLightTurn(int id, String turnMode) throws ShellyApiException;
79 public void setBrightness(int id, int brightness, boolean autoOn) throws ShellyApiException;
82 public void setValveMode(int id, boolean auto) throws ShellyApiException;
84 public void setValveTemperature(int valveId, int value) throws ShellyApiException;
86 public void setValveProfile(int valveId, int value) throws ShellyApiException;
88 public void setValvePosition(int valveId, double value) throws ShellyApiException;
90 public void setValveBoostTime(int valveId, int value) throws ShellyApiException;
92 public void startValveBoost(int valveId, int value) throws ShellyApiException;
94 public ShellyOtaCheckResult checkForUpdate() throws ShellyApiException;
96 public ShellySettingsUpdate firmwareUpdate(String uri) throws ShellyApiException;
98 public ShellySettingsLogin getLoginSettings() throws ShellyApiException;
100 public ShellySettingsLogin setLoginCredentials(String user, String password) throws ShellyApiException;
102 public String setWiFiRecovery(boolean enable) throws ShellyApiException;
104 public boolean setWiFiRangeExtender(boolean enable) throws ShellyApiException;
106 public boolean setEthernet(boolean enable) throws ShellyApiException;
108 public boolean setBluetooth(boolean enable) throws ShellyApiException;
110 public String deviceReboot() throws ShellyApiException;
112 public String setDebug(boolean enabled) throws ShellyApiException;
114 public String getDebugLog(String id) throws ShellyApiException;
116 public String setCloud(boolean enabled) throws ShellyApiException;
118 public String setApRoaming(boolean enable) throws ShellyApiException;
120 public String factoryReset() throws ShellyApiException;
122 public String resetStaCache() throws ShellyApiException;
124 public int getTimeoutsRecovered();
126 public int getTimeoutErrors();
128 public String getCoIoTDescription() throws ShellyApiException;
130 public ShellySettingsLogin setCoIoTPeer(String peer) throws ShellyApiException;
132 public void setActionURLs() throws ShellyApiException;
134 public void sendIRKey(String keyCode) throws ShellyApiException, IllegalArgumentException;