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