asynchronous tasks one after another
Hello!
I implemented a charging point and a CSMS based on the examples and comments I found, and now, I want to implement a full charging scenario for smart charging.

The CSMS:

The script:

So my problem is that after I receive the answer from the CSMS for the authorization, I want the coroutine to be terminated and go to the next step which is the start transaction. When the start transaction receives an answer to go to the remote start of charging and goes like this. But what happens is that is stuck there and waiting. Do you have any idea what should I do?
Thanks!
I want the coroutine to be terminated
Which one?
after I receive the answer from the CSMS for the authorization, [...] and go to the next step which is the start transaction.
Seems like you might need the @after() decorator.
Maybe I wasn't very clear. Sorry about that.
I meant this part here, the asyncio.gather should collect an answer from the csms. Here is what CSMS does:

And here is what the charging point sees:

After I receive this answer, I want to store it and run another coroutinee for the remote start and stop, but the asyncio.gather is stuck there after the answer.
Thanks for your time!
Thanks for clarifying. It seems that you're question is more related to asyncio, than this library. I suggest to take a look at the documentation of asyncio.gather() and asyncio.wait().
The docs of asyncio.gather() state:
If all awaitables are completed successfully, the result is an aggregate list of returned values. The order of result values corresponds to the order of awaitables in aws.
asyncio.wait() seems what you need. Quoting the docs:
Run awaitable objects in the aws iterable concurrently and block until the condition specified by return_when.
The use of wait never receives something:

It also didn't work with other conditions, only gather receives the answer fromt he CSMS.
Thanks again!