I think I found the error eventually.

The version of python is too old. python-kasa needs 3.7 and I have 3.6. I believe it uses asyncio changes that are new to 3.7. So I’ll postpone my experiments until I do an upgrade.