mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-25 11:45:49 +01:00
Set UNINITIALIZED -> HANDLER_MISSING_ERROR after enabling a Thing and handler is missing (#1243)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
parent
c50766d7c3
commit
0046774eb6
@ -1057,7 +1057,7 @@ public class ThingManagerImpl
|
||||
initializeHandler(thing);
|
||||
} else {
|
||||
logger.debug(
|
||||
"Not registering a handler at this point. The thing types of bundle {} are not fully loaded yet.",
|
||||
"Not registering a handler at this point. The thing types of bundle '{}' are not fully loaded yet.",
|
||||
identifier);
|
||||
}
|
||||
} else {
|
||||
@ -1214,6 +1214,11 @@ public class ThingManagerImpl
|
||||
} else {
|
||||
// No handler registered. Try to register handler and initialize the thing.
|
||||
registerAndInitializeHandler(thing, findThingHandlerFactory(thing.getThingTypeUID()));
|
||||
// Check if registration was successful
|
||||
if (!hasBridge(thing) && !isHandlerRegistered(thing)) {
|
||||
setThingStatus(thing,
|
||||
buildStatusInfo(ThingStatus.UNINITIALIZED, ThingStatusDetail.HANDLER_MISSING_ERROR));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!thing.isEnabled()) {
|
||||
|
@ -683,7 +683,7 @@ public class ThingManagerOSGiJavaTest extends JavaOSGiTest {
|
||||
waitForAssert(() -> {
|
||||
assertThat(storage.containsKey(THING_UID.getAsString()), is(false));
|
||||
assertThat(thing.getStatus(), is(ThingStatus.UNINITIALIZED));
|
||||
assertThat(thing.getStatusInfo().getStatusDetail(), is(ThingStatusDetail.DISABLED));
|
||||
assertThat(thing.getStatusInfo().getStatusDetail(), is(ThingStatusDetail.HANDLER_MISSING_ERROR));
|
||||
}, SafeCaller.DEFAULT_TIMEOUT - 100, 50);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user