diff --git a/bin/augment_metadata b/bin/augment_metadata index d48f6ddf7..1cc4cb3d3 100755 --- a/bin/augment_metadata +++ b/bin/augment_metadata @@ -6,17 +6,17 @@ # if [[ $# -lt 2 ]]; then - echo Usage: $0 SITE_DIR DEVICE_ID [PUBBER_OPTS...] + echo Usage: $0 SITE_DIR DEVICE_ID [METADATA_OPTS...] false fi site_dir=$(realpath $1) device_id=$2 shift 2 -pubber_opts=$* +metadata_opts=$* nostate=false -if [[ $pubber_opts =~ noState ]]; then +if [[ $metadata_opts =~ noState ]]; then nostate=true fi diff --git a/validator/src/main/java/com/google/daq/mqtt/sequencer/SequenceBase.java b/validator/src/main/java/com/google/daq/mqtt/sequencer/SequenceBase.java index 8b03c7232..b103f012c 100644 --- a/validator/src/main/java/com/google/daq/mqtt/sequencer/SequenceBase.java +++ b/validator/src/main/java/com/google/daq/mqtt/sequencer/SequenceBase.java @@ -179,6 +179,7 @@ public class SequenceBase { public static final int SCHEMA_SCORE_TOTAL = 10; public static final int CAPABILITY_SCORE = 1; public static final String STATUS_LEVEL_VIOLATION = "STATUS_LEVEL"; + public static final String RECEIVED_STATE_VIOLATION = "RECEIVED_STATE"; public static final String DEVICE_STATE_SCHEMA = "device_state"; private static final String ALL_CHANGES = ""; private static final int SEQUENCER_FUNCTIONS_VERSION = Validator.TOOLS_FUNCTIONS_VERSION; @@ -1880,7 +1881,12 @@ private synchronized void handleUpdateMessage(String subTypeRaw, isoConvert(stateCutoffThreshold), lastStart, txnId)); return; } - checkState(deviceSupportsState(), "Received state update with no-state device"); + if (!deviceSupportsState()) { + String violation = "Received state update with no-state device"; + warning(violation); + deviceStateViolations.put(RECEIVED_STATE_VIOLATION, violation); + return; + } boolean deltaState = RECV_STATE_DIFFERNATOR.isInitialized(); List stateChanges = RECV_STATE_DIFFERNATOR.computeChanges(converted); Instant start = ofNullable(convertedState.timestamp).orElseGet(Date::new).toInstant();