mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-19 00:20:26 +00:00
30 lines
754 B
Java
30 lines
754 B
Java
package com.bwssystems.HABridge;
|
|
|
|
import java.util.Timer;
|
|
import java.util.TimerTask;
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
public class LinkButtonPressed extends TimerTask {
|
|
private static final Logger log = LoggerFactory.getLogger(LinkButtonPressed.class);
|
|
private BridgeControlDescriptor linkDescriptor;
|
|
private Timer myTimer;
|
|
private boolean isSilent;
|
|
|
|
public LinkButtonPressed(BridgeControlDescriptor theDescriptor, Timer aTimer, boolean keepSilent) {
|
|
linkDescriptor = theDescriptor;
|
|
myTimer = aTimer;
|
|
isSilent = keepSilent;
|
|
}
|
|
|
|
@Override
|
|
public void run() {
|
|
if(!isSilent)
|
|
log.info("Link button time ended....");
|
|
linkDescriptor.setLinkButton(false);
|
|
myTimer.cancel();
|
|
}
|
|
|
|
}
|