mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[epsonprojector] Update powerstate when Thing is offline (#20474)
* Update powerstate when Thing is offline Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
This commit is contained in:
+1
@@ -26,6 +26,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public enum PowerStatus {
|
||||
OFFLINE(-1),
|
||||
STANDBY(0x00),
|
||||
ON(0x01),
|
||||
WARMUP(0x02),
|
||||
|
||||
+5
@@ -450,7 +450,12 @@ public class EpsonProjectorHandler extends BaseThingHandler {
|
||||
try {
|
||||
logger.debug("Closing connection to device '{}'", this.thing.getUID());
|
||||
device.get().disconnect();
|
||||
isPowerOn = false;
|
||||
|
||||
updateStatus(ThingStatus.OFFLINE);
|
||||
if (isLinked(CHANNEL_TYPE_POWERSTATE)) {
|
||||
updateState(CHANNEL_TYPE_POWERSTATE, new StringType(PowerStatus.OFFLINE.toString()));
|
||||
}
|
||||
} catch (EpsonProjectorException e) {
|
||||
logger.debug("Error occurred when closing connection to device '{}'", this.thing.getUID(), e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user