async def send_authorize(self): request = call.AuthorizePayload(id_tag="123456") response = await self.call(request) if response.id_tag_info['status'] == AuthorizationStatus.accepted: print("It is authorized.")
async def authorize(self): # request = call.AuthorizePayload( id_tag= "001gmh", # Required. This contains the identifier that needs to be authorized. ) response = await self.call(request) print("authorize response is ", response)
async def send_authorize(self, id_tag_rfid): request = call.AuthorizePayload(id_tag=id_tag_rfid) response = await self.call(request) if response.id_tag_info['status'] == RegistrationStatus.accepted: print(" Authorizated by central system.") return True else: print("For some reason we are out, go home kid") return False
async def send_start_transaction(self): # {"connectorId": 0, "idTag": "ABC123", "meterStart": 10, "timestamp":"2019-12-20T00:00:00+00.00"} await asyncio.sleep(20) request = call.AuthorizePayload(id_tag="21", ) response = await self.call(request) if response.id_tag_info["status"] == AuthorizationStatus.accepted: print("User authorized.") request = call.StartTransactionPayload( connector_id=0, id_tag="21", meter_start=0, timestamp=datetime.datetime.now().isoformat( ) #"2019-12-20T00:00:00+00:00" ) response = await self.call(request) if response.id_tag_info["status"] == AuthorizationStatus.accepted: print("Transaction started.") self.last_transaction_id = response.transaction_id
async def send_auth(self): request = call.AuthorizePayload(id_tag='150C8596') response = await self.call(request) print(response)
async def send_authorize(self): """Send an authorize request.""" request = call.AuthorizePayload(id_tag="test_cp") resp = await self.call(request) assert resp.id_tag_info["status"] == AuthorizationStatus.accepted
async def send_authorize(self): request1 = call.AuthorizePayload(id_tag="miTagId9999") response2 = await self.call(request1)