[hue] Improve handling of unknown resource ID (API v2) (#16020)

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen 2023-12-08 15:53:58 +01:00 committed by GitHub
parent d14733f100
commit 849117c7a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -602,7 +602,7 @@ public class Clip2ThingHandler extends BaseThingHandler {
String resourceId = config.resourceId; String resourceId = config.resourceId;
if (resourceId.isBlank()) { if (resourceId.isBlank()) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"@text/offline.api2.conf-error.resource-id-bad"); "@text/offline.api2.conf-error.resource-id-missing");
return; return;
} }
thisResource.setId(resourceId); thisResource.setId(resourceId);
@ -700,8 +700,8 @@ public class Clip2ThingHandler extends BaseThingHandler {
.ifPresentOrElse(r -> onResource(r), () -> { .ifPresentOrElse(r -> onResource(r), () -> {
if (resourceType == thisResource.getType()) { if (resourceType == thisResource.getType()) {
logger.debug("{} -> onResourcesList() configuration error: unknown resourceId", resourceId); logger.debug("{} -> onResourcesList() configuration error: unknown resourceId", resourceId);
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.GONE,
"@text/offline.api2.conf-error.resource-id-bad"); "@text/offline.api2.gone.resource-id-unknown");
} }
}); });
} }

View 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.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.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.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.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 # scene channel description