[epsonprojector] Fix ONLINE status reporting (#10266)

* Epsonprojector - Fix ONLINE status reporting
* review changes

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
This commit is contained in:
mlobstein 2021-03-02 12:21:39 -06:00 committed by GitHub
parent 037bfa77ea
commit 51ddbdb84d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View 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());