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