Created
September 9, 2021 13:28
-
-
Save elbruno/27872d6b4749171ff6f2aac865d84afc to your computer and use it in GitHub Desktop.
updateDigitalTwinPropertiesinAzIoTEdgeModule.py
This file contains 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
def update_device_state(results, source, doorState, doorStateDesc): | |
global module_client | |
try: | |
# update twin properties | |
reported_patch = {"doorState": doorState} | |
asyncio.run(module_client.patch_twin_reported_properties(reported_patch)) | |
reported_patch = {"doorStateDesc": doorStateDesc} | |
asyncio.run(module_client.patch_twin_reported_properties(reported_patch)) | |
reported_patch = {"doorStateSource": source} | |
asyncio.run(module_client.patch_twin_reported_properties(reported_patch)) | |
except Exception as e: | |
AzureIoTLogger.Log ( "update_device_state - Unexpected error %s " % e ) | |
raise |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment