diff --git a/bundles/org.openhab.binding.telegram/pom.xml b/bundles/org.openhab.binding.telegram/pom.xml
index d16911c839d..14a43d424b9 100644
--- a/bundles/org.openhab.binding.telegram/pom.xml
+++ b/bundles/org.openhab.binding.telegram/pom.xml
@@ -22,7 +22,7 @@
com.github.pengrad
java-telegram-bot-api
- 4.9.0
+ 5.2.0
compile
diff --git a/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramBindingConstants.java b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramBindingConstants.java
index 1ec63509cb9..4c575a49d45 100644
--- a/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramBindingConstants.java
+++ b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramBindingConstants.java
@@ -41,5 +41,4 @@ public class TelegramBindingConstants {
public static final String LASTMESSAGEUSERNAME = "lastMessageUsername";
public static final String CHATID = "chatId";
public static final String REPLYID = "replyId";
- public static final String LONGPOLLINGTIME = "longPollingTime";
}
diff --git a/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandler.java b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandler.java
index fa6cb46effe..c47df21ddce 100644
--- a/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandler.java
+++ b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandler.java
@@ -419,7 +419,7 @@ public class TelegramHandler extends BaseThingHandler {
@SuppressWarnings("rawtypes")
@Nullable
- public R execute(BaseRequest request) {
+ public R execute(BaseRequest, R> request) {
TelegramBot localBot = bot;
return localBot != null ? localBot.execute(request) : null;
}
diff --git a/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/action/TelegramActions.java b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/action/TelegramActions.java
index 61932b4d73e..f25c42eb8fb 100644
--- a/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/action/TelegramActions.java
+++ b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/action/TelegramActions.java
@@ -312,9 +312,9 @@ public class TelegramActions implements ThingActions {
if (username != null && password != null) {
AuthenticationStore auth = client.getAuthenticationStore();
URI uri = URI.create(photoURL);
- auth.addAuthenticationResult(new BasicResult(HttpHeader.AUTHORIZATION, uri,
- "Basic " + Base64.getEncoder().encodeToString(
- (username + ":" + password).getBytes(StandardCharsets.ISO_8859_1))));
+ auth.addAuthenticationResult(
+ new BasicResult(HttpHeader.AUTHORIZATION, uri, "Basic " + Base64.getEncoder()
+ .encodeToString((username + ":" + password).getBytes(StandardCharsets.UTF_8))));
}
try {
// API has 10mb limit to jpg file size, without this it can only accept 2mb
@@ -326,6 +326,7 @@ public class TelegramActions implements ThingActions {
sendPhoto = new SendPhoto(chatId, fileContent);
} else {
logger.warn("Download from {} failed with status: {}", photoURL, contentResponse.getStatus());
+ sendTelegram(chatId, caption + ":Download failed with status " + contentResponse.getStatus());
return false;
}
} catch (InterruptedException | ExecutionException e) {
@@ -450,6 +451,7 @@ public class TelegramActions implements ThingActions {
} else {
logger.warn("Download from {} failed with status: {}", animationURL,
contentResponse.getStatus());
+ sendTelegram(chatId, caption + ":Download failed with status " + contentResponse.getStatus());
return false;
}
} catch (InterruptedException | ExecutionException e) {
@@ -527,6 +529,7 @@ public class TelegramActions implements ThingActions {
sendVideo = new SendVideo(chatId, fileContent);
} else {
logger.warn("Download from {} failed with status: {}", videoURL, contentResponse.getStatus());
+ sendTelegram(chatId, caption + ":Download failed with status " + contentResponse.getStatus());
return false;
}
} catch (InterruptedException | ExecutionException e) {