Private Sub manualControl (zone As String, controlPin As String, state As Int)
Dim jobPost As HttpJob
jobPost.Initialize("jobPost", Me)
currentState = MANUAL_MODE
If state == 1 Then
'not activate, so need to activate
jobPost.PostString("https://api.particle.io/v1/devices/" & deviceName & "/zoneCtrlId", "access_token=" & accessToken & "¶ms=" & controlPin & "," & ON)
manControlFlag = True
Else If state == 0 Then
'not activate, so need to activate
jobPost.PostString("https://api.particle.io/v1/devices/" & deviceName & "/zoneCtrlId", "access_token=" & accessToken & "¶ms=" & controlPin & "," & OFF)
manControlFlag = False
End If
Wait For (jobPost) JobDone(jobPost As HttpJob)
If jobPost.Success = True Then
Log(jobPost.GetString)
cloudRx = jobPost.GetString
updateState
Log("result from Post is : " & result)
Else
Log("job failed")
End If
jobPost.Release
End Su