[amazonechocontrol] fix missing time (backport from 3.0) (#10009)

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
J-N-K 2021-01-31 22:14:01 +01:00 committed by GitHub
parent 31a20dc249
commit 72f43bde98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1279,8 +1279,8 @@ public class EchoHandler extends BaseThingHandler implements IEchoThingHandler {
if (StringUtils.equals(notification.status, "ON")) { if (StringUtils.equals(notification.status, "ON")) {
if ("Reminder".equals(notification.type)) { if ("Reminder".equals(notification.type)) {
String offset = ZoneId.systemDefault().getRules().getOffset(Instant.now()).toString(); String offset = ZoneId.systemDefault().getRules().getOffset(Instant.now()).toString();
ZonedDateTime alarmTime = ZonedDateTime String time = Objects.requireNonNullElse(notification.originalTime, "00:00:00");
.parse(notification.originalDate + "T" + notification.originalTime + offset); ZonedDateTime alarmTime = ZonedDateTime.parse(notification.originalDate + "T" + time + offset);
if (StringUtils.isNotBlank(notification.recurringPattern) && alarmTime.isBefore(now)) { if (StringUtils.isNotBlank(notification.recurringPattern) && alarmTime.isBefore(now)) {
continue; // Ignore recurring entry if alarm time is before now continue; // Ignore recurring entry if alarm time is before now
} }