diff --git a/RandObject.h b/RandObject.h index b7e0d8e..6657737 100644 --- a/RandObject.h +++ b/RandObject.h @@ -14,13 +14,14 @@ class RandObject{ RandObject(){}; void load(JsonVariant data){ reset(); - if(data.is()){ + if(data.is()) useDefault = true; - } - else if(data.is()){ + + else if(data.is()) min = max = data.as(); - } + else if(data.is()){ + JsonObject &d = data.as(); if(d.containsKey("min")) min = d["min"]; @@ -30,6 +31,7 @@ class RandObject{ offset = d["offset"]; if(d.containsKey("multi")) multi = d["multi"]; + } else Serial.println("RandObject is INVALID");