duncangrant commented on a change in pull request #1298:
URL: https://github.com/apache/brooklyn-server/pull/1298#discussion_r801643384
##########
File path:
core/src/main/java/org/apache/brooklyn/policy/InvokeEffectorOnSensorChange.java
##########
@@ -79,18 +79,26 @@ public void setEntity(EntityLocal entity) {
LOG.debug("Defaulting to producer==self for {}, on entity {}",
this, entity);
producer = entity;
}
+ lastValue = entity.sensors().get(sensor);
subscriptions().subscribe(producer, sensor, this);
LOG.debug("{} subscribed to {} events on {}", new Object[]{this,
sensor, entity});
}
@Override
public void onEvent(SensorEvent<Object> event) {
- final Effector<?> eff = getEffectorNamed(getConfig(EFFECTOR)).get();
+ final Object newValue = event.getValue();
+ LOG.debug("lastValue='{}', newValue='{}'", lastValue, newValue);
+ if (String.valueOf(newValue).equals(lastValue)) {
Review comment:
I don't understand why you're converting to a string here - sensors can
hold any object type.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]