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

Feature to support setting twin reported properties during simulation #377

Merged

Conversation

avagraw
Copy link
Contributor

@avagraw avagraw commented Jun 22, 2021


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Thank you for contributing to the IoT extension!

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • If introducing new functionality or modified behavior, are they backed by unit and integration tests?
  • In the same context as above are command names and their parameter definitions accurate? Do help docs have sufficient content?
  • Have all unit and integration tests passed locally? i.e. pytest <project root> -vv
  • Have static checks passed using the .pylintrc and .flake8 rules? Look at the CI scripts for example usage.
  • Have you made an entry in HISTORY.rst which concisely explains your feature or change?

digimaun and others added 30 commits May 17, 2021 14:51
…ure#341)

* Introducing IoT Hub dataplane RBAC support.
* IoT Hub rbac support for most commands.
* Removed deprecated nested IoT edge artifacts.
* Removed deprecated show-connection-string artifacts.
* --auth-type supports configurable defaults.
* Improved IoT Hub test infrastructure.
* Significant refactor of IoT Hub tests.
* Various additional improvements.
* All warnings from tests are now shown.
* Uamqp integration with jwt auth.
* Modify HISTORY.rst
* add support for v1 and preview routes
* update history file
* address review comments
* lint fixes
)

* Add warning for qos deprecation and update contributing guide
* removing version from deprecate_info
* Integration tests command update in Contributing guide
* remove preview tags
* history updates
…#344)

* Fix for new identity parameter format
* test updates
* better differentiation of storage vars
* updated to remove *all* user-identitites after storage tests until CLI core is patched
* pr comments
* update dt reset to only support deleting both
* Remove unused import
* Remove hiding of warnings from sample pytest.ini
* update to use wait
* fix error status code
* int testing
* update help
* initial changes
* update params, help
* add missing module to test
* Word change
* Pipeline updates

Added nightly build pipeline

Added template to run tests against minimum supported AZ CLI

* Pipeline parameter refactoring

* Moved deprecated ubuntu images to `ubuntu-latest`

Co-authored-by: Paymaun <[email protected]>
c-ryan-k and others added 12 commits June 2, 2021 15:26
… - update help to reflect the change (Azure#346)

* Add warning for qos deprecation and update contributing guide

* removing version from deprecate_info

* Integration tests command update in Contributing guide

* Update help message for d2c command and mqtt simulation to indicate only sas auth is supported

* Checks and error messages when non SAS devices are used for MQTT operations

* Indentation update in help file

* fix styling

* Adding enum and updating test

* Addressed comments
@avagraw avagraw requested a review from digimaun as a code owner June 22, 2021 23:56
@avagraw
Copy link
Contributor Author

avagraw commented Jun 23, 2021

Integration tests pass, except a couple:

image

Failed integration tests also pass:

image
image
image

@c-ryan-k c-ryan-k self-assigned this Jun 23, 2021
@avagraw avagraw merged commit 4d072be into Azure:device_client_integration Jun 24, 2021
}
}

_iot_device_twin_update(self.target, self.device_id, twin_properties)
Copy link
Member

Choose a reason for hiding this comment

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

The goal of this functionality is to be able to init device side (reported) properties. The implementation here is setting service side desired properties.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update to the desired properties is picked up by the MQTT listener, which automatically updates the reported properties, hence bringing the desired and reported properties in sync.

Copy link
Member

Choose a reason for hiding this comment

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

But you don't need to set desired properties to apply the initial reported state. Devices connecting to IoT Hub will provide their initial state through reported properties without needing to make a modification to desired. Desired twin properties are a solution side interaction and its strange that we would force an update to the desired twin state in order to update the reported side when using facilities of a device simulation command. The primary justification that I see right now is implementation convenience.

You can take a look at this device sample as an example/datapoint - the device connects to iothub initializing a set of reported properties (reflecting a pnp device) with no modification to the desired/solution side interaction.

avagraw added a commit to avagraw/azure-iot-cli-extension that referenced this pull request Jul 28, 2021
…Azure#377)

* Introducing IoT Hub dataplane RBAC support + various improvements (Azure#341)

* Introducing IoT Hub dataplane RBAC support.
* IoT Hub rbac support for most commands.
* Removed deprecated nested IoT edge artifacts.
* Removed deprecated show-connection-string artifacts.
* --auth-type supports configurable defaults.
* Improved IoT Hub test infrastructure.
* Significant refactor of IoT Hub tests.
* Various additional improvements.
* All warnings from tests are now shown.
* Uamqp integration with jwt auth.
* Modify HISTORY.rst

* Iotc command versioning (Azure#340)

* add support for v1 and preview routes
* update history file
* address review comments
* lint fixes

* Add warning for qos deprecation and update contributing guide (Azure#342)

* Add warning for qos deprecation and update contributing guide
* removing version from deprecate_info
* Integration tests command update in Contributing guide

* Integrate TQDM to show progress bar when simulator sends d2c messages

* remove unused loop varable

* Update progress bar descriptionb

* Iotc command ga (Azure#348)

* remove preview tags
* history updates

* Use enum value instead of literal str. (Azure#349)

* Managed identity support for device-identity import and export  (Azure#344)

* Fix for new identity parameter format
* test updates
* better differentiation of storage vars
* updated to remove *all* user-identitites after storage tests until CLI core is patched

* Update azext_metadata.json (Azure#351)

* Increment version to v0.10.13

* Update README.md

* Update HISTORY.rst

* update twin reported properties during simulation

* update unit tests

* Add dataplane reset (Azure#352)

* pr comments
* update dt reset to only support deleting both
* Remove unused import

* styling updates

* C2D messaging improvements. (Azure#354)

* Remove hiding of warnings from sample pytest.ini

* Digital Twin wait commands (Azure#345)

* update to use wait
* fix error status code
* int testing
* update help

* Add Identity Storage Account ID param to sentinel values (Azure#355)

* Using SDK Listener for Twin properties update

* Module identity renew key (Azure#356)

* initial changes
* update params, help
* add missing module to test
* Word change

* Update README.md

* merge from remote

* Pipeline updates (Azure#359)

* Pipeline updates

Added nightly build pipeline

Added template to run tests against minimum supported AZ CLI

* Pipeline parameter refactoring

* Moved deprecated ubuntu images to `ubuntu-latest`

Co-authored-by: Paymaun <[email protected]>

* Structured mqtt formatting and eliminate dependency on six

* remove indent property not needed any more

* Check for conditionals before running test jobs (Azure#363)

* Update d2c and simulate commands to return errors for non SaS devices - update help to reflect the change (Azure#346)

* Add warning for qos deprecation and update contributing guide

* removing version from deprecate_info

* Integration tests command update in Contributing guide

* Update help message for d2c command and mqtt simulation to indicate only sas auth is supported

* Checks and error messages when non SAS devices are used for MQTT operations

* Indentation update in help file

* fix styling

* Adding enum and updating test

* Addressed comments

* Support C2D Message decoding and Add TQDM for HTTP simulation

* Update MQTT operations to run on web sockets

* Remove duplicate test already in dev branch

* Device connection is automatic now

* Styling update

* Feature to support setting twin reported properties during simulation

* Remove extra quote

* update twin reported properties during simulation

* update unit tests

* styling updates

* Using SDK Listener for Twin properties update

* Support C2D Message decoding and Add TQDM for HTTP simulation

* Merging changes

Co-authored-by: Paymaun <[email protected]>
Co-authored-by: valluriraj <[email protected]>
Co-authored-by: Ryan K <[email protected]>
Co-authored-by: Paymaun Heidari <[email protected]>
Co-authored-by: vilit1 <[email protected]>
avagraw added a commit to avagraw/azure-iot-cli-extension that referenced this pull request Jul 28, 2021
…Azure#377)

* Introducing IoT Hub dataplane RBAC support + various improvements (Azure#341)

* Introducing IoT Hub dataplane RBAC support.
* IoT Hub rbac support for most commands.
* Removed deprecated nested IoT edge artifacts.
* Removed deprecated show-connection-string artifacts.
* --auth-type supports configurable defaults.
* Improved IoT Hub test infrastructure.
* Significant refactor of IoT Hub tests.
* Various additional improvements.
* All warnings from tests are now shown.
* Uamqp integration with jwt auth.
* Modify HISTORY.rst

* Iotc command versioning (Azure#340)

* add support for v1 and preview routes
* update history file
* address review comments
* lint fixes

* Add warning for qos deprecation and update contributing guide (Azure#342)

* Add warning for qos deprecation and update contributing guide
* removing version from deprecate_info
* Integration tests command update in Contributing guide

* Integrate TQDM to show progress bar when simulator sends d2c messages

* remove unused loop varable

* Update progress bar descriptionb

* Iotc command ga (Azure#348)

* remove preview tags
* history updates

* Use enum value instead of literal str. (Azure#349)

* Managed identity support for device-identity import and export  (Azure#344)

* Fix for new identity parameter format
* test updates
* better differentiation of storage vars
* updated to remove *all* user-identitites after storage tests until CLI core is patched

* Update azext_metadata.json (Azure#351)

* Increment version to v0.10.13

* Update README.md

* Update HISTORY.rst

* update twin reported properties during simulation

* update unit tests

* Add dataplane reset (Azure#352)

* pr comments
* update dt reset to only support deleting both
* Remove unused import

* styling updates

* C2D messaging improvements. (Azure#354)

* Remove hiding of warnings from sample pytest.ini

* Digital Twin wait commands (Azure#345)

* update to use wait
* fix error status code
* int testing
* update help

* Add Identity Storage Account ID param to sentinel values (Azure#355)

* Using SDK Listener for Twin properties update

* Module identity renew key (Azure#356)

* initial changes
* update params, help
* add missing module to test
* Word change

* Update README.md

* merge from remote

* Pipeline updates (Azure#359)

* Pipeline updates

Added nightly build pipeline

Added template to run tests against minimum supported AZ CLI

* Pipeline parameter refactoring

* Moved deprecated ubuntu images to `ubuntu-latest`

Co-authored-by: Paymaun <[email protected]>

* Structured mqtt formatting and eliminate dependency on six

* remove indent property not needed any more

* Check for conditionals before running test jobs (Azure#363)

* Update d2c and simulate commands to return errors for non SaS devices - update help to reflect the change (Azure#346)

* Add warning for qos deprecation and update contributing guide

* removing version from deprecate_info

* Integration tests command update in Contributing guide

* Update help message for d2c command and mqtt simulation to indicate only sas auth is supported

* Checks and error messages when non SAS devices are used for MQTT operations

* Indentation update in help file

* fix styling

* Adding enum and updating test

* Addressed comments

* Support C2D Message decoding and Add TQDM for HTTP simulation

* Update MQTT operations to run on web sockets

* Remove duplicate test already in dev branch

* Device connection is automatic now

* Styling update

* Feature to support setting twin reported properties during simulation

* Remove extra quote

* update twin reported properties during simulation

* update unit tests

* styling updates

* Using SDK Listener for Twin properties update

* Support C2D Message decoding and Add TQDM for HTTP simulation

* Merging changes

Co-authored-by: Paymaun <[email protected]>
Co-authored-by: valluriraj <[email protected]>
Co-authored-by: Ryan K <[email protected]>
Co-authored-by: Paymaun Heidari <[email protected]>
Co-authored-by: vilit1 <[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.

5 participants