예제 #1
0
 async def send_boot_notification(self):
     """Send a boot notification."""
     request = call.BootNotificationPayload(
         charge_point_model="Optimus",
         charge_point_vendor="The Mobility House")
     resp = await self.call(request)
     assert resp.status == RegistrationStatus.accepted
예제 #2
0
    async def boot_notification(self):  #
        request = call.BootNotificationPayload(
            charge_point_model=
            "Optimus",  #Required. This contains a value that identifies the model of the ChargePoint.
            charge_point_vendor=
            "NOEVmh_vendor",  #Required. This contains a value that identifies the vendor of the ChargePoint.
            charge_box_serial_number=
            "1111",  #Optional. This contains a value that identifies the serial number of the Charge Box inside the Charge Point. Deprecated, will be removed in future version
            charge_point_serial_number=
            "2222",  #Optional. This contains a value that identifies the serial number of the Charge Point.
            firmware_version=
            "3333",  #Optional. This contains the firmware version of the Charge Point.
            iccid=
            "4444",  #Optional. This contains the ICCID of the modem’s SIM card.
            imsi=
            "5555",  #Optional. This contains the IMSI of the modem’s SIM card.
            meter_serial_number=
            "6666",  # Optional. This contains the serial number of the main electrical meter of the Charge Point.
            meter_type=
            "7777",  #Optional. This contains the type of the main electrical meter of the Charge Point.
        )

        response = await self.call(request)

        if response.status == RegistrationStatus.accepted:
            print("Connected to central system!!!!!!!!.")
예제 #3
0
async def test_send_receive():
    async with websockets.connect(WEBSOCKET_URL) as websocket:
        boot_notification_payload = call.BootNotificationPayload(
            charge_point_model="Test", charge_point_vendor="Test")
        get_configuration_payload = call_result.GetConfigurationPayload(
            configuration_key=[{
                "key": "GetConfigurationMaxKeys",
                "readonly": True,
                "value": "10",
            }])
        ocppj_message = payload_to_ocppj_message(boot_notification_payload,
                                                 class_type=Call,
                                                 unique_id=str(uuid4()))
        await websocket.send(ocppj_message)  # -> Call/BootNotificationPayload
        call_result_msg = (await websocket.recv()
                           )  # <- CallResult/BootNotificationPayload
        call_result_obj = unpack(call_result_msg)
        log.info(call_result_obj)
        assert type(call_result_obj) == CallResult
        call_msg = await websocket.recv()  # <- Call/GetConfiguration
        call_obj = unpack(call_msg)
        log.info(call_obj)
        assert type(call_obj) == Call
        unique_id = call_obj.unique_id  # use Call's unique_id in CallResult
        ocppj_message = payload_to_ocppj_message(get_configuration_payload,
                                                 class_type=CallResult,
                                                 unique_id=unique_id)
        log.info(ocppj_message)
        await websocket.send(ocppj_message)  # -> CallResult/GetConfiguration
예제 #4
0
    async def send_boot_notification(self):
        request = call.BootNotificationPayload(charge_point_model="EVity-01",
                                               charge_point_vendor="IBS Corp.")

        response = await self.call(request)

        if response.status == RegistrationStatus.accepted:
            print("Connected to central system.")
예제 #5
0
    async def boot_notification(self):
        payload = call.BootNotificationPayload(
            charge_point_vendor="Alfen BV",
            charge_point_model="ICU Eve Mini",
            firmware_version="#1:3.4.0-2990#N:217H;1.0-223",
        )

        await self.call(payload)
예제 #6
0
    async def send_boot_notification(self):  # 发送 请求 send_boot_notification
        request = call.BootNotificationPayload(
            charge_point_model="Optimus", charge_point_vendor="NOEVmh_vendor")

        response = await self.call(request)

        if response.status == RegistrationStatus.accepted:
            print("Connected to central system!!!!!!!!.")
예제 #7
0
    async def send_boot_notification(self):
        request = call.BootNotificationPayload(
            charge_point_model='Model S',
            charge_point_vendor='TravDawg'
        )
        response = await self.call(request)

        if response.status == 'Accepted':
            print("Connected to central system.")
예제 #8
0
    async def send_boot_notification(self):
        request = call.BootNotificationPayload(
            charge_point_model="Optimus",
            charge_point_vendor="The Mobility House"
        )
        print("Send Boot Notification From Client Hit")
        response = await self.call(request)

        if response.status ==  RegistrationStatus.accepted:
            print("Connected to central system.")
예제 #9
0
    async def boot_notification(self):
        payload = call.BootNotificationPayload(
            charge_point_vendor="Alfen BV",
            charge_point_model="ICU Eve Mini",
            firmware_version="#1:3.4.0-2990#N:217H;1.0-223",
        )

        response = await self.call(payload)
        if response.status == RegistrationStatus.accepted:
            log.info('Charge Point accepted!')
 async def on_boot_notification(self, **kwargs):
     print("on_boot_notification")
     payload = call.BootNotificationPayload(**kwargs)
     await self.register_charging_station(self.id,
                                          payload)  # make internal call
     return call_result.BootNotificationPayload(
         current_time=datetime.utcnow().isoformat(),
         interval=10,
         status="Accepted",
     )
예제 #11
0
    async def send_boot_notification(self):
        request = call.BootNotificationPayload(
            charge_point_model="Brand",
            charge_point_vendor="The Mobility House",
            charge_point_serial_number="serial123")

        response = await self.call(request)

        if response.status == RegistrationStatus.accepted:
            print("Connected to central system.")
예제 #12
0
 def on_boot_notification(self, **payload):
     """
     Callback function for BootNotification messages
     """
     logger.console("=> BootNotification " + str(payload))
     if "BootNotification" in self.__awaited_msgs:
         self.__msgq.put(call.BootNotificationPayload(**payload))
     return call_result.BootNotificationPayload(
         current_time=datetime.utcnow().isoformat(),
         interval=5,
         status='Accepted'
         )
예제 #13
0
    async def send_boot_notification(self, c_p_model, c_p_vendor):
        await asyncio.sleep(1)

        request = call.BootNotificationPayload(charge_point_model=c_p_model,
                                               charge_point_vendor=c_p_vendor)
        response = await self.call(request)

        if response.status == RegistrationStatus.accepted:
            print("Connected to central system.")
            hb = response.interval
            print("Heartbeat changed to ", hb, " seconds")
            return (hb)
        else:
            print("Not connected to central system")
예제 #14
0
 async def send_boot_notification(self):
     request = call16.BootNotificationPayload(charge_point_model="Alpha",
                                              charge_point_vendor="Vendor")
     print(f"(Charging Station) {self.id=} -> {request=}")
     response: call_result16 = await self.call(request)
     print(f"(Charging Station) {self.id=} <- {response=}")