mihai-dinculescu / tapo

Unofficial Tapo API Client. Works with TP-Link Tapo smart devices. Tested with light bulbs (L510, L520, L530, L610, L630), light strips (L900, L920, L930), plugs (P100, P105, P110, P115, P300), hubs (H100), switches (S200B) and sensors (KE100, T100, T110, T300, T310, T315).
MIT License
318 stars 30 forks source link

ImportError: cannot import name 'ApiClient' from partially initialized module 'tapo' (most likely due to a circular import) #165

Closed vihatsoft closed 5 months ago

vihatsoft commented 5 months ago

Install pip module with pip install tapo

Get error when run python file python /home/admin/tapo.py ImportError: cannot import name 'ApiClient' from partially initialized module 'tapo' (most likely due to a circular import) (/home/admin/tapo.py)

tapo.py


import asyncio
from tapo import ApiClient

async def main():
    client = ApiClient("xxxxx@gmail.com", "xxxx")
    device = await client.l530("192.168.x.xx")

    await device.off()

asyncio.run(main())
mihai-dinculescu commented 5 months ago

What Python version and OS are you using?

vihatsoft commented 5 months ago

What Python version and OS are you using?

python 3.9.2

mihai-dinculescu commented 5 months ago

Tapo Python v0.2.0 should be working. Please give it a try.

vihatsoft commented 5 months ago

Tapo Python v0.2.0 should be working. Please give it a try.

Yes Now working fine. toggleOnOff available?

mihai-dinculescu commented 5 months ago

There is an example available that shows how the toggle behaviour can be achieved.