Skip to content

Commit

Permalink
[jablotron] Migrate to v2.2 API (#16743)
Browse files Browse the repository at this point in the history
Signed-off-by: Ondrej Pecta <opecta@gmail.com>
  • Loading branch information
octa22 committed May 11, 2024
1 parent 2b83e74 commit 85a45ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ private String getCommonUrlParameters(String serviceId) {
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() {
Expand Down

0 comments on commit 85a45ce

Please sign in to comment.