From 94d110a98ccfe3be3b143ea5b176b78ab323117d Mon Sep 17 00:00:00 2001 From: Jacob Laursen Date: Wed, 20 Dec 2023 18:38:53 +0100 Subject: [PATCH] [surepetcare] Fix DateTimeParseException (#16087) Fixes #16082 Signed-off-by: Jacob Laursen --- .../utils/GsonZonedDateTimeTypeAdapter.java | 8 +++- .../data/SurePetcareTopologyTest.java | 48 +++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/utils/GsonZonedDateTimeTypeAdapter.java b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/utils/GsonZonedDateTimeTypeAdapter.java index 4b4f19d12dc..573570eb889 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/utils/GsonZonedDateTimeTypeAdapter.java +++ b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/utils/GsonZonedDateTimeTypeAdapter.java @@ -15,6 +15,7 @@ package org.openhab.binding.surepetcare.internal.utils; import java.lang.reflect.Type; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -76,6 +77,11 @@ public class GsonZonedDateTimeTypeAdapter implements JsonSerializer