[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:
mlobstein
2026-03-30 14:13:28 +02:00
committed by GitHub
parent a7bfdff602
commit cc07d55d51
2 changed files with 6 additions and 0 deletions
@@ -26,6 +26,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
*/
@NonNullByDefault
public enum PowerStatus {
OFFLINE(-1),
STANDBY(0x00),
ON(0x01),
WARMUP(0x02),
@@ -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);
}