use of org.eclipse.smarthome.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DeviceSensorValue in project smarthome by eclipse.
the class DeviceImpl method checkAndSetSensorValue.
private boolean checkAndSetSensorValue(Object obj, Integer dsValue, Float floatValue) {
boolean isSet = false;
if (obj != null) {
DeviceSensorValue devSenVal = getDeviceSensorValueForSet(obj);
if (devSenVal != null) {
if (dsValue != null && floatValue != null) {
isSet = devSenVal.setValues(floatValue, dsValue);
} else if (dsValue != null) {
isSet = devSenVal.setDsValue(dsValue);
} else if (floatValue != null) {
isSet = devSenVal.setFloatValue(floatValue);
}
logger.debug("check devSenVal {} isSet={}", devSenVal.toString(), isSet);
checkSensorValueSet(devSenVal, isSet);
}
}
return isSet;
}
use of org.eclipse.smarthome.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DeviceSensorValue in project smarthome by eclipse.
the class DeviceImpl method setDeviceSensorByEvent.
@Override
public void setDeviceSensorByEvent(EventItem event) {
DeviceSensorValue devSenVal = new DeviceSensorValue(event.getProperties());
if (devSenVal != null) {
SensorEnum sensorType = devSenVal.getSensorType();
if (!isEchoSensor(sensorType)) {
logger.debug("Event is no echo, set values {} for sensorType {}", devSenVal, devSenVal.getSensorType());
if (SensorEnum.isPowerSensor(sensorType) && getSensorDataReadingInitialized(sensorType)) {
logger.debug("SensorJob was initialized, remove sensorjob for sensorType: {}", devSenVal.getSensorType());
deviceStateUpdates.add(new DeviceStateUpdateImpl(sensorType, -1));
}
setDeviceSensorValue(devSenVal);
} else {
logger.debug("Event is echo remove sensorType {} from echoBox", devSenVal.getSensorType());
sensorEchoBox.remove(devSenVal.getSensorType());
}
}
}
Aggregations