Here is my simplified pyscript -
async def auth(brand):
async with aiohttp.ClientSession() as session:
async with session.post(url_auth) as resp:
...
return auth_token_b64
@service
def get_counters(address_id):
auth_token_b64 = await auth(brand)
...
It worked well when I used it locally with asyncio.run(get_counters(address_id=1))
.
But now I've uploaded the file to Home Assistant and there I get the following error -
return auth_token_b64
TypeError: object str can't be used in 'await' expression
What is wrong here?