Skip to content
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: Add new Properties field to Device DTO and Model #800

Merged
merged 1 commit into from
Feb 17, 2023

Conversation

judehung
Copy link
Member

@judehung judehung commented Feb 16, 2023

Add an extendable field into Device DTO and Model: Properties map[string]any
This is useful for some devices that requires extra information. For example, a BACnet device may have properties such as DeviceInstance, Firmware, InstanceID, and ObjectName.

fixes #769

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/go-mod-core-contracts/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

New Dependency Instructions (If applicable)

Add an extendable field into Device DTO and Model:
Properties map[string]any
This is useful for some devices that requires extra information. For example, a BACnet device may have properties such as DeviceInstance, Firmware, InstanceID, and ObjectName.

fixes edgexfoundry#769

Signed-off-by: Jude Hung <[email protected]>
@codecov-commenter
Copy link

Codecov Report

Merging #800 (66fa623) into main (57cbd60) will decrease coverage by 0.12%.
The diff coverage is 14.28%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #800      +/-   ##
==========================================
- Coverage   64.42%   64.31%   -0.12%     
==========================================
  Files          80       80              
  Lines        3092     3099       +7     
==========================================
+ Hits         1992     1993       +1     
- Misses        911      915       +4     
- Partials      189      191       +2     
Impacted Files Coverage Δ
dtos/requests/device.go 85.29% <0.00%> (-5.34%) ⬇️
dtos/device.go 36.20% <33.33%> (-0.16%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@judehung judehung marked this pull request as ready for review February 16, 2023 05:58
Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cloudxxx8 cloudxxx8 merged commit 6280729 into edgexfoundry:main Feb 17, 2023
judehung added a commit to judehung/device-sdk-go that referenced this pull request Feb 18, 2023
…Device dto

Per edgexfoundry/go-mod-core-contracts#800, the
Device DTO is added with a new field "Properties", so the swagger file needs to be updated correspondingly.

Moreover, this commit also updates the swagger file to remove those fields that had been taken out of Device DTO before:
- created
- modified
- serviceId
- profileId

This commit also adds back a newly created field "tags" into the Device DTO.

Signed-off-by: Jude Hung <[email protected]>
judehung added a commit to judehung/edgex-go that referenced this pull request Feb 20, 2023
…Device DTO

Per edgexfoundry/go-mod-core-contracts#800, the Device DTO is added with a new field properties, so the swagger file of core-metadata needs to be updated correspondingly.
This commit also updates the swagger with newly created field tags of the Device DTO.

Signed-off-by: Jude Hung <[email protected]>
judehung added a commit to judehung/edgex-go that referenced this pull request Feb 20, 2023
…Device DTO

Per edgexfoundry/go-mod-core-contracts#800, the Device DTO is added with a new field properties, so the swagger file of core-metadata needs to be updated correspondingly.
This commit also updates the swagger with newly created field tags of the Device DTO.

Signed-off-by: Jude Hung <[email protected]>
judehung added a commit to judehung/edgex-docs that referenced this pull request Feb 22, 2023
…isionWatcher dto

Per edgexfoundry/go-mod-core-contracts#803 and edgexfoundry/go-mod-core-contracts#800, new fields `properties` are added into Device dto and ProvisionWatcher dto. This PR updates edgex-docs with the description of these new fields.

Signed-off-by: Jude Hung <[email protected]>
judehung added a commit to judehung/edgex-docs that referenced this pull request Feb 22, 2023
…isionWatcher dto

Per edgexfoundry/go-mod-core-contracts#803 and edgexfoundry/go-mod-core-contracts#800, new fields `properties` are added into Device dto and ProvisionWatcher dto. This PR updates edgex-docs with the description of these new fields.

fixes edgexfoundry#969

Signed-off-by: Jude Hung <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EdgeX 3.0] Device model improvement
3 participants