mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[jablotron] Migrate to v2.2 API (#16743)
Signed-off-by: Ondrej Pecta <opecta@gmail.com> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
parent
1218199345
commit
762d7b4933
@ -54,11 +54,13 @@ public class JablotronBindingConstants {
|
||||
public static final String CHANNEL_STATUS_PGY = "statusPGY";
|
||||
|
||||
// Constants
|
||||
public static final String JABLOTRON_API_URL = "https://api.jablonet.net/api/1.6/";
|
||||
public static final String AGENT = "Swagger-Codegen/1.0.0/android";
|
||||
public static final String JABLOTRON_API_URL = "https://api.jablonet.net/api/2.2/";
|
||||
public static final String AGENT = "net.jablonet/8.3.5.3331 (iPhone 14 Pro Max; iOS 17.4; )";
|
||||
public static final int TIMEOUT_SEC = 10;
|
||||
public static final String SYSTEM = "openHAB";
|
||||
public static final String VENDOR = "JABLOTRON:Jablotron";
|
||||
public static final String CLIENT_VERSION = "MYJ-PUB-IOS-8.3.5.3331";
|
||||
public static final String CLIENT_DEVICE = "Apple|iPhone 14 Pro Max|17.4";
|
||||
public static final String APPLICATION_JSON = "application/json";
|
||||
public static final String WWW_FORM_URLENCODED = "application/x-www-form-urlencoded; charset=UTF-8";
|
||||
public static final String AUTHENTICATION_CHALLENGE = "Authentication challenge without WWW-Authenticate header";
|
||||
|
@ -399,7 +399,8 @@ public class JablotronBridgeHandler extends BaseBridgeHandler {
|
||||
private Request createRequest(String url) {
|
||||
return httpClient.newRequest(url).method(HttpMethod.POST).header(HttpHeader.ACCEPT, APPLICATION_JSON)
|
||||
.header(HttpHeader.ACCEPT_LANGUAGE, bridgeConfig.getLang()).header(HttpHeader.ACCEPT_ENCODING, "*")
|
||||
.header("x-vendor-id", VENDOR).agent(AGENT).timeout(TIMEOUT_SEC, TimeUnit.SECONDS);
|
||||
.header("x-vendor-id", VENDOR).header("x-client-version", CLIENT_VERSION)
|
||||
.header("x-client-device", CLIENT_DEVICE).agent(AGENT).timeout(TIMEOUT_SEC, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
private void relogin() {
|
||||
|
Loading…
Reference in New Issue
Block a user