Пример #1
0
 def on_status_notification(self, connector_id: int, error_code: str,
                            status: str, timestamp: str, info: str,
                            vendor_id: str, vendor_error_code: str,
                            **kwargs):
     global idConector
     idConector = connector_id
     return call_result.StatusNotificationPayload()
Пример #2
0
    async def _on_status_notification(
            self,
            connector_id: int,
            error_code: ChargePointErrorCode,
            status: ChargePointStatus,
            timestamp: str = None,
            info: str = None,
            vendor_id: str = None,
            vendor_error_code: str = None,
            **kwargs) -> call_result.StatusNotificationPayload:
        # Get the connector object this notification references
        connector = self._get_connector(connector_id)

        # Generate the database object
        err = ChargePointError(
            connector=connector,
            error_code=error_code,
            status=status,
            timestamp=timestamp if timestamp else utc_datetime(),
            info=info,
            vendor_id=vendor_id,
            vendor_error_code=vendor_error_code)

        # TODO: Prevent logging non error status messages
        # self._session.add(err)
        # self._session.commit()

        return call_result.StatusNotificationPayload()
Пример #3
0
    def on_status_notification(self, status, **kwargs):
        """
        This contains the field definition of the FirmwareStatusNotification.conf PDU
        sent by the Central System to the Charge Point in response to
        a FirmwareStatusNotification.req PDU.
        """

        return call_result.StatusNotificationPayload()
Пример #4
0
 def on_status_notification(self, **payload):
     """
     Callback function for StatusNotification messages
     """
     logger.console("=> StatusNotification " + str(payload))
     if "StatusNotification" in self.__awaited_msgs:
         self.__msgq.put(call.StatusNotificationPayload(**payload))
     return call_result.StatusNotificationPayload()
Пример #5
0
 def on_status_notification(self, connector_id, error_code, status,
                            time_stamp, info, vendor_id, vendor_error_code):
     return call_result.StatusNotificationPayload(
         connectorId=connector_id,
         errorCode=error_code,
         status=status,
         timeStamp=time_stamp,
         info=info,
         vendorId=vendor_id,
         vendorErrorCode=vendor_error_code)
Пример #6
0
    def on_status_notification(self, **kwargs):
        print("cp -> server , on_status_notification: \n", kwargs, "\n")
        self.export_json_file(kwargs, "./dataFromCp2Server",
                              "StatusNotification.req")

        response = call_result.StatusNotificationPayload()
        self.export_json_file(response.__dict__, "./dataFromCp2Server",
                              "StatusNotification.con")
        print("server -> cp, on_status_notification: \n", response, "\n")
        return response
Пример #7
0
 def status_notification(self, **kwargs):
     return call_result.StatusNotificationPayload()
Пример #8
0
 def on_status_notification(self, connector_id: int, error_code: str,
                            status: str, timestamp: str, info: str,
                            vendor_id: str, vendor_error_code: str):
     return call_result.StatusNotificationPayload()
Пример #9
0
def test_create_call_error_invalid():
    payload = asdict(call_result_v16.StatusNotificationPayload())
    call_result: CallResult = CallResult(unique_id=123, payload=payload)
    message = call_result.to_json()
    with pytest.raises(ValueError):
        create_call_error(message)