Пример #1
0
async def on_connect(websocket, path):  # 等待client 链接 传来的参数是charge point传来的
    """ For every new charge point that connects, create a ChargePoint instance
    and start listening for messages.

    """

    charge_point_id = path.strip('/')  #

    cp = ChargePoint(charge_point_id, websocket)  #
    # create_gui(cp)

    # 将每个cp添加到字典里
    EVSE_dict[charge_point_id] = cp

    # print(cp)
    # print(EVSE_dict)

    def which_function_1():
        fun2 = cp.send_remote_start_transaction()

    fun1 = cp.start()
    fun2 = cp.send_remote_start_transaction()

    await asyncio.gather(
        fun1,
        fun2,
        # cp.send_remote_stop_transaction(),
        #                      # cp.send_clear_cache_request()
    )
Пример #2
0
 def which_function_1():
     fun2 = cp.send_remote_start_transaction()