'global
Dim job As HttpJob
jobPost.Initialize("jobPost", Me)
Private Sub manualControl (zone As String, controlPin As String, state As Int)
'check result
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
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "jobGet"
Log(Job.GetString)
cloudRx = Job.GetString
Case "jobPost"
Log(Job.GetString)
cloudRx = Job.GetString
'could check for error code to see if command was successfull
End Select
updateState
Else
Log("Error: " & Job.ErrorMessage)
'mess'messagePToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub