Commit message

This commit is contained in:
support.sampyo 2024-07-04 06:14:16 +00:00
parent 5c41e0664d
commit 797816a6f5
2 changed files with 25 additions and 31 deletions

View File

@ -7,5 +7,5 @@ spec:
virtualEnv: base # 사용할 가상환경 이름입니다.
package: requirements.txt # 설치할 Python 패키지 정보 파일입니다.(기본 값은 requirement.txt 입니다.)
stackbase:
tagName: v0.0.44 # Stackbase(gitea)에 릴리즈 태그명 입니다.
tagName: v0.0.45 # Stackbase(gitea)에 릴리즈 태그명 입니다.
repoName: sampyo-dio # Stackbase(gitea)에 저장될 저장소 이릅니다.

50
main.py
View File

@ -43,30 +43,27 @@ def Valve_PureWater(chip, status, action, duration=7):
chip.set_values(status)
time.sleep(0.05)
if action == 'On':
status[2] = 1
status[3] = 0
chip.set_values(status)
time.sleep(duration)
else: # 'Off'
if pure_value_status != 0:
if pure_valve_status != 0 and action == 'Off':
status[2] = 0
status[3] = 1
chip.set_values(status)
time.sleep(7)
pure_valve_status = 0
elif pure_valve_status == 0 and action == 'On':
status[2] = 1
status[3] = 0
chip.set_values(status)
time.sleep(duration)
if duration >= 7:
pure_valve_status = 2
elif duration < 7:
pure_valve_status = 1
status[2] = 0
status[3] = 0
chip.set_values(status)
time.sleep(0.05)
if action == 'On' and duration >= 7:
pure_valve_status = 2
elif action == 'On' and duration < 7:
pure_valve_status = 1
else:
pure_valve_status = 0
def Valve_EnterWater(chip, status, action):
if action == 'On':
status[4] = 1
@ -83,30 +80,27 @@ def Valve_MainWater(chip, status, action, duration=7):
chip.set_values(status)
time.sleep(0.05)
if action == 'On':
status[5] = 1
status[6] = 0
chip.set_values(status)
time.sleep(duration)
else: # 'Off'
if main_valve_status != 0:
if main_valve_status != 0 and action == 'Off':
status[5] = 0
status[6] = 1
chip.set_values(status)
time.sleep(7)
main_valve_status = 0
elif main_valve_status == 0 and action == 'On':
status[5] = 1
status[6] = 0
chip.set_values(status)
time.sleep(duration)
if duration >= 7:
main_valve_status = 2
elif duration < 7:
main_valve_status = 1
status[5] = 0
status[6] = 0
chip.set_values(status)
time.sleep(0.05)
if action == 'On' and duration >= 7:
main_valve_status = 2
elif action == 'On' and duration < 7:
main_valve_status = 1
else:
main_valve_status = 0
def Measure_Weight(client):
# print('in')
val = 0