use of com.tinkerforge.BrickletMotionDetector in project openhab1-addons by openhab.
the class MBrickletMotionDetectorImpl method enable.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void enable() {
tinkerforgeDevice = new BrickletMotionDetector(getUid(), getIpConnection());
motionDetectedListener = new BrickletMotionDetector.MotionDetectedListener() {
@Override
public void motionDetected() {
logger.debug("{} motion detected: {}", LoggerConstants.TFMODELUPDATE, getUid());
setSensorValue(HighLowValue.HIGH);
}
};
tinkerforgeDevice.addMotionDetectedListener(motionDetectedListener);
detectionCycleEndedListener = new BrickletMotionDetector.DetectionCycleEndedListener() {
@Override
public void detectionCycleEnded() {
logger.debug("{} motion end: {}", LoggerConstants.TFMODELUPDATE, getUid());
setSensorValue(HighLowValue.LOW);
}
};
tinkerforgeDevice.addDetectionCycleEndedListener(detectionCycleEndedListener);
fetchSensorValue();
}
use of com.tinkerforge.BrickletMotionDetector in project openhab1-addons by openhab.
the class MBrickletMotionDetectorImpl method setTinkerforgeDevice.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setTinkerforgeDevice(BrickletMotionDetector newTinkerforgeDevice) {
BrickletMotionDetector oldTinkerforgeDevice = tinkerforgeDevice;
tinkerforgeDevice = newTinkerforgeDevice;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MBRICKLET_MOTION_DETECTOR__TINKERFORGE_DEVICE, oldTinkerforgeDevice, tinkerforgeDevice));
}
Aggregations