]> git.basschouten.com Git - openhab-addons.git/commitdiff
[hue] Improve handling of unknown resource ID (API v2) (#16020)
authorJacob Laursen <jacob-github@vindvejr.dk>
Fri, 8 Dec 2023 14:53:58 +0000 (15:53 +0100)
committerGitHub <noreply@github.com>
Fri, 8 Dec 2023 14:53:58 +0000 (15:53 +0100)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/Clip2ThingHandler.java
bundles/org.openhab.binding.hue/src/main/resources/OH-INF/i18n/hue.properties

index 95ecbcd1392c441650d0f4a0b026d81ca1685a79..30a49dc3c195df630de162295b2d92c909a21970 100644 (file)
@@ -602,7 +602,7 @@ public class Clip2ThingHandler extends BaseThingHandler {
         String resourceId = config.resourceId;
         if (resourceId.isBlank()) {
             updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
-                    "@text/offline.api2.conf-error.resource-id-bad");
+                    "@text/offline.api2.conf-error.resource-id-missing");
             return;
         }
         thisResource.setId(resourceId);
@@ -700,8 +700,8 @@ public class Clip2ThingHandler extends BaseThingHandler {
                     .ifPresentOrElse(r -> onResource(r), () -> {
                         if (resourceType == thisResource.getType()) {
                             logger.debug("{} -> onResourcesList() configuration error: unknown resourceId", resourceId);
-                            updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
-                                    "@text/offline.api2.conf-error.resource-id-bad");
+                            updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.GONE,
+                                    "@text/offline.api2.gone.resource-id-unknown");
                         }
                     });
         }
index b6d1dbb42159aece43d76821e3abd44be0af0f69..48219ed5cca428fcd22188c45c6f00ebaa3de125 100644 (file)
@@ -259,8 +259,9 @@ offline.api2.conf-error.assets-not-loaded = Bridge/Thing handler assets not load
 offline.api2.conf-error.press-pairing-button = Not authenticated. Press pairing button on the Hue Bridge or set a valid application key in configuration.
 offline.api2.conf-error.read-only = Configuration update failed. Please update the configuration manually.
 offline.api2.conf-error.clip2-not-supported = The Hue Bridge does not support API v2.
-offline.api2.conf-error.resource-id-bad = Configuration resourceId is bad.
+offline.api2.conf-error.resource-id-missing = Resource ID is not configured.
 offline.api2.conf-error.not-authorized = The application key is not authorized.
+offline.api2.gone.resource-id-unknown = Resource ID is unknown to the bridge.
 
 # scene channel description