]> git.basschouten.com Git - openhab-addons.git/commitdiff
[epsonprojector] Fix ONLINE status reporting (#10266)
authormlobstein <michael.lobstein@gmail.com>
Tue, 2 Mar 2021 18:21:39 +0000 (12:21 -0600)
committerGitHub <noreply@github.com>
Tue, 2 Mar 2021 18:21:39 +0000 (10:21 -0800)
* Epsonprojector - Fix ONLINE status reporting
* review changes

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
bundles/org.openhab.binding.epsonprojector/src/main/java/org/openhab/binding/epsonprojector/internal/handler/EpsonProjectorHandler.java

index d9029b21de245174acc649e79c65c3738a053c0a..2d8cc2ca414972d4ae5057777d93c954ff7397f5 100644 (file)
@@ -156,10 +156,13 @@ public class EpsonProjectorHandler extends BaseThingHandler {
             State state = queryDataFromDevice(epsonCommand);
 
             if (state != null) {
-                updateStatus(ThingStatus.ONLINE);
                 if (isLinked(channel.getUID())) {
                     updateState(channel.getUID(), state);
                 }
+                // the first valid response will cause the thing to go ONLINE
+                if (state != UnDefType.UNDEF) {
+                    updateStatus(ThingStatus.ONLINE);
+                }
             }
         } catch (IllegalArgumentException e) {
             logger.warn("Unknown channel {}", channel.getUID().getId());