From dcc33b979caa417bd18f6a9f551dd21c8e597427 Mon Sep 17 00:00:00 2001 From: J-N-K Date: Mon, 1 Jan 2024 11:55:27 +0100 Subject: [PATCH] [http] Use core channel updates (#553) Signed-off-by: Jan N. Klug --- .../http/internal/HttpThingHandler.java | 4 ++-- .../resources/OH-INF/update/instructions.xml | 19 +++++++++++++++++++ .../src/main/resources/update/url.update | 3 --- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 bundles/org.smarthomej.binding.http/src/main/resources/OH-INF/update/instructions.xml delete mode 100644 bundles/org.smarthomej.binding.http/src/main/resources/update/url.update diff --git a/bundles/org.smarthomej.binding.http/src/main/java/org/smarthomej/binding/http/internal/HttpThingHandler.java b/bundles/org.smarthomej.binding.http/src/main/java/org/smarthomej/binding/http/internal/HttpThingHandler.java index 0004dcd594..04a282dde8 100644 --- a/bundles/org.smarthomej.binding.http/src/main/java/org/smarthomej/binding/http/internal/HttpThingHandler.java +++ b/bundles/org.smarthomej.binding.http/src/main/java/org/smarthomej/binding/http/internal/HttpThingHandler.java @@ -45,6 +45,7 @@ import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingStatus; import org.openhab.core.thing.ThingStatusDetail; +import org.openhab.core.thing.binding.BaseThingHandler; import org.openhab.core.thing.binding.generic.ChannelHandler; import org.openhab.core.thing.binding.generic.ChannelHandlerContent; import org.openhab.core.thing.binding.generic.ChannelMode; @@ -73,7 +74,6 @@ import org.smarthomej.binding.http.internal.http.RateLimitedHttpClient; import org.smarthomej.binding.http.internal.http.RefreshingUrlCache; import org.smarthomej.commons.SimpleDynamicStateDescriptionProvider; -import org.smarthomej.commons.UpdatingBaseThingHandler; /** * The {@link HttpThingHandler} is responsible for handling commands, which are @@ -82,7 +82,7 @@ * @author Jan N. Klug - Initial contribution */ @NonNullByDefault -public class HttpThingHandler extends UpdatingBaseThingHandler implements HttpStatusListener { +public class HttpThingHandler extends BaseThingHandler implements HttpStatusListener { private static final Set URL_PART_DELIMITER = Set.of('/', '?', '&'); private final Logger logger = LoggerFactory.getLogger(HttpThingHandler.class); diff --git a/bundles/org.smarthomej.binding.http/src/main/resources/OH-INF/update/instructions.xml b/bundles/org.smarthomej.binding.http/src/main/resources/OH-INF/update/instructions.xml new file mode 100644 index 0000000000..7343854b90 --- /dev/null +++ b/bundles/org.smarthomej.binding.http/src/main/resources/OH-INF/update/instructions.xml @@ -0,0 +1,19 @@ + + + + + + + http:requestDateTime + + + + http:requestDateTime + + + + + + diff --git a/bundles/org.smarthomej.binding.http/src/main/resources/update/url.update b/bundles/org.smarthomej.binding.http/src/main/resources/update/url.update deleted file mode 100644 index c2c8f9c673..0000000000 --- a/bundles/org.smarthomej.binding.http/src/main/resources/update/url.update +++ /dev/null @@ -1,3 +0,0 @@ -# add last success and last failure channels -1;ADD_CHANNEL;lastSuccess,DateTime,http:requestDateTime,Last Success -1;ADD_CHANNEL;lastFailure,DateTime,http:requestDateTime,Last Failure \ No newline at end of file