updated the desired property acknowledgemnt for new IoT Central apps

This commit is contained in:
Ian Hollier 2021-01-28 13:29:07 -08:00
Родитель 9d323e9955
Коммит b058ceb653
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -103,7 +103,8 @@ async def desired_ack(json_data, status_code, status_text):
if list(json_data.keys())[0] == "$version": if list(json_data.keys())[0] == "$version":
key = list(json_data.keys())[1] key = list(json_data.keys())[1]
reported_payload = {key:{"value":json_data[key]['value'],"statusCode":status_code,"status":status_text,"desiredVersion":json_data['$version']}} reported_payload = {key:{"value": json_data[key], "ac":status_code,"ad":status_text,"av":json_data['$version']}}
print(reported_payload) print(reported_payload)
await device_client.patch_twin_reported_properties(reported_payload) await device_client.patch_twin_reported_properties(reported_payload)