property won't set if it is read only.#156
Open
fatmehosseini wants to merge 2 commits into
Open
Conversation
rzr
reviewed
Jun 23, 2023
| } | ||
| bool isInRange(ThingDataValue value){ | ||
| return (this->maximum < this->minimum) //to check if minimum and maximum values are asigned | ||
| || (this->maximum > value.) |
Author
There was a problem hiding this comment.
Sorry, at first I was going to handle the process of validation the range in a function then decide to do it directly but forget to delete the function. this function is not used and should delete.
Author
There was a problem hiding this comment.
should I just create another pull request?
Collaborator
|
It looks like commit message and code differ |
Collaborator
Collaborator
|
what about read only test ? |
Author
|
rzr
approved these changes
Jun 26, 2023
| void setProperty(const char *name, const JsonVariant &newValue) { | ||
| ThingProperty *property = findProperty(name); | ||
|
|
||
| if(property->readOnly) |
Collaborator
|
Please lint source and squash https://github.com/WebThingsIO/webthing-arduino/actions/runs/5363544169/jobs/9763863783?pr=156 |
Collaborator
|
Is anyone interested to take over this work ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
I noticed that read only parameter is not used. If a user put value to a read only property it will be accepted.
Also about integer and number properties if the put property be less than minimum or more than maximum the server wouldn't care and accept the new value for the property.
I made some changes to prevent accept new value in mentioned case.