-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support Object value type in Reading #1025
Conversation
Handle the object value type for the event reading Closes #1024 Signed-off-by: bruce <[email protected]>
This PR should hold until edgexfoundry/go-mod-core-contracts#666 merged. |
pkg/models/commandvalue.go
Outdated
@@ -429,6 +429,16 @@ func (cv *CommandValue) BinaryValue() ([]byte, error) { | |||
return value, nil | |||
} | |||
|
|||
// ObjectValue returns the value in object data type, and returns error if the Type is not Object. | |||
func (cv *CommandValue) ObjectValue() (interface{}, error) { | |||
var value float64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why using float64
here and not interface{}
?
I see that it is a noop for the error, but it makes the code confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it's redundant, removed.
@weichou1229 Please reference the Docs PR for this enhancement in the PR. |
Closes #1024 Signed-off-by: bruce <[email protected]>
Added the link. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #1024 Signed-off-by: bruce <[email protected]>
Upgrade the core-contracts lib from v2.0.1-dev.18 to v2.0.1-dev.19 |
Codecov Report
@@ Coverage Diff @@
## main #1025 +/- ##
==========================================
+ Coverage 40.70% 40.75% +0.04%
==========================================
Files 29 29
Lines 3002 3011 +9
==========================================
+ Hits 1222 1227 +5
- Misses 1686 1690 +4
Partials 94 94
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #1024
Signed-off-by: bruce [email protected]
PR Checklist
Please check if your PR fulfills the following requirements:
Added doc description to swagger API feat(data): Support Object value type in Reading edgex-go#3742
If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/device-sdk-c/blob/master/.github/CONTRIBUTING.md
What is the current behavior?
Issue Number: #1024
What is the new behavior?
Handle the object value type for the event reading
Does this PR introduce a breaking change?
New Imports
Specific Instructions
Other information