mat-plus-app/main.py

32 lines
781 B
Python
Raw Permalink Normal View History

2024-04-30 06:36:42 +00:00
import sdtcloudpubsub
import time
import uuid
sdtcloud = sdtcloudpubsub.sdtcloudpubsub()
sdtcloud.setClient(f"device-app-{uuid.uuid1()}") # parameter is client ID(string)
def runAction():
while True:
msg = {
"input_pressure" : 1,
"input_flow" : 1,
"output_pressure" : 1,
"output_flow" : 1,
"Util_value":{
"cpu_temperature" : 70,
"fan1_rpm" : 2000,
"fan2_rpm" : 2000
},
"user_set_value":{
"input1_str" : "stage1",
"input2_str" : "stage2",
"input3_str" : "stage3"
}
}
sdtcloud.pubMessage(msg)
time.sleep(2)
if __name__ == "__main__":
runAction()