]> git.basschouten.com Git - openhab-addons.git/blob
8b7716007d83ae37f713da7727f6160da5bc35a2
[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     void resetMeterTotal(int id) throws ShellyApiException;
58
59     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     void setValveMode(int id, boolean auto) throws ShellyApiException;
84
85     void setValveTemperature(int valveId, int value) throws ShellyApiException;
86
87     void setValveProfile(int valveId, int value) throws ShellyApiException;
88
89     void setValvePosition(int valveId, double value) throws ShellyApiException;
90
91     void setValveBoostTime(int valveId, int value) throws ShellyApiException;
92
93     void startValveBoost(int valveId, int value) throws ShellyApiException;
94
95     void muteSmokeAlarm(int smokeId) throws ShellyApiException;
96
97     ShellyOtaCheckResult checkForUpdate() throws ShellyApiException;
98
99     ShellySettingsUpdate firmwareUpdate(String uri) throws ShellyApiException;
100
101     ShellySettingsLogin getLoginSettings() throws ShellyApiException;
102
103     ShellySettingsLogin setLoginCredentials(String user, String password) throws ShellyApiException;
104
105     String setWiFiRecovery(boolean enable) throws ShellyApiException;
106
107     boolean setWiFiRangeExtender(boolean enable) throws ShellyApiException;
108
109     boolean setEthernet(boolean enable) throws ShellyApiException;
110
111     boolean setBluetooth(boolean enable) throws ShellyApiException;
112
113     String deviceReboot() throws ShellyApiException;
114
115     String setDebug(boolean enabled) throws ShellyApiException;
116
117     String getDebugLog(String id) throws ShellyApiException;
118
119     String setCloud(boolean enabled) throws ShellyApiException;
120
121     String setApRoaming(boolean enable) throws ShellyApiException;
122
123     String factoryReset() throws ShellyApiException;
124
125     String resetStaCache() throws ShellyApiException;
126
127     int getTimeoutsRecovered();
128
129     int getTimeoutErrors();
130
131     String getCoIoTDescription() throws ShellyApiException;
132
133     ShellySettingsLogin setCoIoTPeer(String peer) throws ShellyApiException;
134
135     void setActionURLs() throws ShellyApiException;
136
137     void sendIRKey(String keyCode) throws ShellyApiException, IllegalArgumentException;
138
139     void postEvent(String device, String index, String event, Map<String, String> parms) throws ShellyApiException;
140
141     void close();
142
143     void startScan();
144 }