]> git.basschouten.com Git - openhab-addons.git/blob
536bda9c6c960ec094c9a8eb2f1ad8d3dc018cfc
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.shelly.internal.api;
14
15 import java.util.Map;
16
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;
29
30 /**
31  * The {@link ShellyApiInterface} Defines device API
32  *
33  * @author Markus Michels - Initial contribution
34  */
35 @NonNullByDefault
36 public interface ShellyApiInterface {
37     public boolean isInitialized();
38
39     public void initialize() throws ShellyApiException;
40
41     public void setConfig(String thingName, ShellyThingConfiguration config);
42
43     public ShellySettingsDevice getDeviceInfo() throws ShellyApiException;
44
45     public ShellyDeviceProfile getDeviceProfile(String thingType) throws ShellyApiException;
46
47     public ShellySettingsStatus getStatus() throws ShellyApiException;
48
49     public void setLedStatus(String ledName, Boolean value) throws ShellyApiException;
50
51     public void setSleepTime(int value) throws ShellyApiException;
52
53     public ShellyStatusRelay getRelayStatus(int relayIndex) throws ShellyApiException;
54
55     public void setRelayTurn(int id, String turnMode) throws ShellyApiException;
56
57     public ShellyRollerStatus getRollerStatus(int rollerIndex) throws ShellyApiException;
58
59     public void setRollerTurn(int relayIndex, String turnMode) throws ShellyApiException;
60
61     public void setRollerPos(int relayIndex, int position) throws ShellyApiException;
62
63     public void setAutoTimer(int index, String timerName, double value) throws ShellyApiException;
64
65     public ShellyStatusSensor getSensorStatus() throws ShellyApiException;
66
67     public ShellyStatusLight getLightStatus() throws ShellyApiException;
68
69     public ShellyShortLightStatus getLightStatus(int index) throws ShellyApiException;
70
71     public void setLightMode(String mode) throws ShellyApiException;
72
73     public void setLightParm(int lightIndex, String parm, String value) throws ShellyApiException;
74
75     public void setLightParms(int lightIndex, Map<String, String> parameters) throws ShellyApiException;
76
77     public ShellyShortLightStatus setLightTurn(int id, String turnMode) throws ShellyApiException;
78
79     public void setBrightness(int id, int brightness, boolean autoOn) throws ShellyApiException;
80
81     // Valve
82     public void setValveMode(int id, boolean auto) throws ShellyApiException;
83
84     public void setValveTemperature(int valveId, int value) throws ShellyApiException;
85
86     public void setValveProfile(int valveId, int value) throws ShellyApiException;
87
88     public void setValvePosition(int valveId, double value) throws ShellyApiException;
89
90     public void setValveBoostTime(int valveId, int value) throws ShellyApiException;
91
92     public void startValveBoost(int valveId, int value) throws ShellyApiException;
93
94     public ShellyOtaCheckResult checkForUpdate() throws ShellyApiException;
95
96     public ShellySettingsUpdate firmwareUpdate(String uri) throws ShellyApiException;
97
98     public ShellySettingsLogin getLoginSettings() throws ShellyApiException;
99
100     public ShellySettingsLogin setLoginCredentials(String user, String password) throws ShellyApiException;
101
102     public String setWiFiRecovery(boolean enable) throws ShellyApiException;
103
104     public boolean setWiFiRangeExtender(boolean enable) throws ShellyApiException;
105
106     public boolean setEthernet(boolean enable) throws ShellyApiException;
107
108     public boolean setBluetooth(boolean enable) throws ShellyApiException;
109
110     public String deviceReboot() throws ShellyApiException;
111
112     public String setDebug(boolean enabled) throws ShellyApiException;
113
114     public String getDebugLog(String id) throws ShellyApiException;
115
116     public String setCloud(boolean enabled) throws ShellyApiException;
117
118     public String setApRoaming(boolean enable) throws ShellyApiException;
119
120     public String factoryReset() throws ShellyApiException;
121
122     public String resetStaCache() throws ShellyApiException;
123
124     public int getTimeoutsRecovered();
125
126     public int getTimeoutErrors();
127
128     public String getCoIoTDescription() throws ShellyApiException;
129
130     public ShellySettingsLogin setCoIoTPeer(String peer) throws ShellyApiException;
131
132     public void setActionURLs() throws ShellyApiException;
133
134     public void sendIRKey(String keyCode) throws ShellyApiException, IllegalArgumentException;
135
136     public void close();
137 }