|
@ -46,6 +46,7 @@ if json_data != "" and json_data != None: |
|
|
try: |
|
|
try: |
|
|
# Check if node is Authenticated. "cookie |
|
|
# Check if node is Authenticated. "cookie |
|
|
if data['cookie'] != None: |
|
|
if data['cookie'] != None: |
|
|
|
|
|
cookie = data['cookie'] |
|
|
while 1: |
|
|
while 1: |
|
|
# For a while we request to get Parking Status |
|
|
# For a while we request to get Parking Status |
|
|
# witch is a JSON object like [{"no": 1, "status": false}, {"no": 2, "status": true}, ..., {"no": n, "status": true}] |
|
|
# witch is a JSON object like [{"no": 1, "status": false}, {"no": 2, "status": true}, ..., {"no": n, "status": true}] |
|
@ -63,7 +64,7 @@ if json_data != "" and json_data != None: |
|
|
if parkingStatus != prev_status: |
|
|
if parkingStatus != prev_status: |
|
|
# If parking status changed from previous status |
|
|
# If parking status changed from previous status |
|
|
# server would informed about this change. |
|
|
# server would informed about this change. |
|
|
data = """{"no":""" + parkingCode + ""","status":""" + parkingStatus + """}""" |
|
|
data = """{"no":""" + parkingCode + ""","status":""" + parkingStatus + """, "cookie": \"""" + cookie + """\"}""" |
|
|
r = s.post(url = API_ENDPOINT, data = data) |
|
|
r = s.post(url = API_ENDPOINT, data = data) |
|
|
|
|
|
|
|
|
# IO : node prints to output the current |
|
|
# IO : node prints to output the current |
|
|