Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
updateDigitalTwinPropertiesinAzIoTEdgeModule.py
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