Commit message
This commit is contained in:
parent
370d851500
commit
c1f26f9340
|
@ -18,11 +18,11 @@
|
|||
},
|
||||
"enter":{
|
||||
"action": "Off",
|
||||
"duration": 10
|
||||
"duration": 5
|
||||
},
|
||||
"vent": {
|
||||
"action": "Off",
|
||||
"duration": 30,
|
||||
"duration": 15,
|
||||
"holding": 2
|
||||
},
|
||||
"motor": {
|
||||
|
|
|
@ -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)에 저장될 저장소 이릅니다.
|
||||
|
|
7
main.py
7
main.py
|
@ -56,7 +56,7 @@ 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]
|
||||
|
@ -64,6 +64,7 @@ def Measure_Weight(client):
|
|||
val /= 1000
|
||||
# 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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue