Пример #1
0
async def main():
    async with websockets.connect('ws://149.56.47.168:8080/PCremote',
                                  subprotocols=['ocpp1.6']) as ws:

        cp = ChargePoint('CP_1', ws)

        await asyncio.gather(cp.start(), cp.send_boot_notification(),
                             cp.send_authorize(), cp.send_start_transaction())
Пример #2
0
async def main():
    async with websockets.connect('%s/serial123' % config.CS_URL,
                                  subprotocols=['ocpp1.6']) as ws:

        cp = ChargePoint('serial123', ws)

        await asyncio.gather(cp.start(), cp.send_boot_notification(),
                             cp.send_heartbeat(), cp.send_start_transaction(),
                             cp.send_stop_transaction())