|
|
@ -46,6 +46,7 @@ if json_data != "" and json_data != None: |
|
|
|
try: |
|
|
|
# Check if node is Authenticated. "cookie |
|
|
|
if data['cookie'] != None: |
|
|
|
cookie = data['cookie'] |
|
|
|
while 1: |
|
|
|
# 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}] |
|
|
@ -63,7 +64,7 @@ if json_data != "" and json_data != None: |
|
|
|
if parkingStatus != prev_status: |
|
|
|
# If parking status changed from previous status |
|
|
|
# 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) |
|
|
|
|
|
|
|
# IO : node prints to output the current |
|
|
|