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