Exemplo n.º 1
0
    async def send_heartbeat(self):

        request = call.HeartbeatPayload()

        response = await self.call(request)

        if response.current_time:
            print("Heartbeat delivered: ", response.current_time)
        else:
            print("Heartbeat not delivered")
Exemplo n.º 2
0
 def on_heartbeat(self):
     """
     callback function for when a heartbeat is received
     """
     logger.console("=> Hearbeat")
     if "Heartbeat" in self.__awaited_msgs:
         self.__msgq.put(call.HeartbeatPayload())
     return call_result.HeartbeatPayload(
         current_time=datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S') + "Z"
         )
Exemplo n.º 3
0
    async def send_heartbeart(self):
        """
        This contains the field definition of the Heartbeat.req PDU sent by
        the Charge Point to the Central System. See also Heartbeat
        No fields are defined.
        """

        request = call.HeartbeatPayload()

        response = await self.call(request)

        print(response.current_time)
Exemplo n.º 4
0
 async def heart_beat(self):
     request = call.HeartbeatPayload()
     response = await self.call(request)
     print("heart beat response is ", response)
Exemplo n.º 5
0
 async def send_heartbeat(self):
     """Send a heartbeat."""
     request = call.HeartbeatPayload()
     resp = await self.call(request)
     assert len(resp.current_time) > 0
Exemplo n.º 6
0
def test_create_call_error():
    payload = asdict(call_v16.HeartbeatPayload())
    call: Call = Call(unique_id=123, action="Heartbeat", payload=payload)
    message = call.to_json()
    call_error: str = create_call_error(message)
    assert type(call_error) is str
Exemplo n.º 7
0
 async def send_heartbeat(self):
     request = call.HeartbeatPayload()
     response = await self.call(request)
     print("Heartbeat sent")