From c1f26f9340370dcbafbe08fedf3fe3f92f641fc0 Mon Sep 17 00:00:00 2001 From: "support.sampyo" Date: Fri, 24 May 2024 06:04:38 +0000 Subject: [PATCH] Commit message --- control.json | 4 ++-- framework.yaml | 2 +- main.py | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/control.json b/control.json index 319a7c3..87d5be4 100644 --- a/control.json +++ b/control.json @@ -18,11 +18,11 @@ }, "enter":{ "action": "Off", - "duration": 10 + "duration": 5 }, "vent": { "action": "Off", - "duration": 30, + "duration": 15, "holding": 2 }, "motor": { diff --git a/framework.yaml b/framework.yaml index e59de20..74860ea 100644 --- a/framework.yaml +++ b/framework.yaml @@ -7,5 +7,5 @@ spec: virtualEnv: base # 사용할 가상환경 이름입니다. package: requirements.txt # 설치할 Python 패키지 정보 파일입니다.(기본 값은 requirement.txt 입니다.) stackbase: - tagName: v0.0.25 # Stackbase(gitea)에 릴리즈 태그명 입니다. + tagName: v0.0.26 # Stackbase(gitea)에 릴리즈 태그명 입니다. repoName: sampyo-dio # Stackbase(gitea)에 저장될 저장소 이릅니다. diff --git a/main.py b/main.py index 3253523..235c213 100644 --- a/main.py +++ b/main.py @@ -56,14 +56,15 @@ def Measure_Weight(client): val = 0 try: result = client.read_holding_registers(1, 1) - if result.iserror(): + if not result: print(f'Error: {result}') else: val = result.registers[0] val -= 1000 val /= 1000 - #print(f'value: {val}') + # print(f'value: {val}') except Exception as e: + print(f'Measure_Weight Error: {e}') pass return float(val) @@ -204,7 +205,7 @@ def runAction(): # 1. device-app-test -> Good # 2. device-app-light-app -> Good # 3. device-test-app -> Bad - global data, client + global data sdtcloud = sdtcloudnodeqmqtt.sdtcloudnodeqmqtt() mqttClient1 = sdtcloud.setClient(f"device-app-1{uuid.uuid1()}") # parameter is client ID(string) mqttClient2 = sdtcloud.setClient(f"device-app-2{uuid.uuid1()}") # parameter is client ID(string) @@ -218,7 +219,6 @@ def runAction(): # - Asset Code's variable: assetCode(string) # - You may need it to create a topic. - cnt = 0 while True: start = time.time() @@ -348,6 +348,7 @@ def exit_handler(signum, frame): Valve_Vent(chip=output_lines, status=status, action='Off') Valve_MixedWater(chip=output_lines, status=status, action='Off') Valve_PureWater(chip=output_lines, status=status, action='Off') + Valve_EnterWater(chip=output_lines, status=status, action='Off') client.close()