Exemplo n.º 1
0
 def on_heartbeat(self, **kwargs):
     """
     This contains the field definition of the Heartbeat.conf PDU sent by the Central System
     to the Charge Point in response to a Heartbeat.req PDU.
     """
     return call_result.HeartbeatPayload(
         current_time=datetime.utcnow().isoformat())
Exemplo n.º 2
0
    def on_heartbeat_notification(self, **kwargs):
        print("on heart beat is", kwargs)
        # self.export_json_file(kwargs, "./dataFromCp2Server", "Heartbeat.req")

        response = call_result.HeartbeatPayload(
            current_time=datetime.utcnow().isoformat())
        # self.export_json_file(response.__dict__, "./dataFromCp2Server", "Heartbeat.con")
        return response
Exemplo n.º 3
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.º 4
0
 def heartbeat_notification(self, **kwargs):
     return call_result.HeartbeatPayload(
         current_time=datetime.utcnow().isoformat())
Exemplo n.º 5
0
 def on_heartbeat(self):
     return call_result.HeartbeatPayload(
         current_time=datetime.utcnow().isoformat())
Exemplo n.º 6
0
    async def _on_heartbeat(self, **kwargs) -> call_result.HeartbeatPayload:
        self._data_object.last_heartbeat = utc_datetime()
        self._session.commit()

        return call_result.HeartbeatPayload(
            current_time=utc_datetime().isoformat())
Exemplo n.º 7
0
 def heart_beat(self):
     return call_result.HeartbeatPayload()