Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import 'LightHander' or 'ColorLightHandler' for typings #218

Closed
alfadormx opened this issue May 18, 2024 · 3 comments
Closed

cannot import 'LightHander' or 'ColorLightHandler' for typings #218

alfadormx opened this issue May 18, 2024 · 3 comments

Comments

@alfadormx
Copy link

alfadormx commented May 18, 2024

Hello,

First of all, thank @mihai-dinculescu for your work in this library.
So, while all we need is to import the ApiClient to use this library, I am trying to add Type support for intellisense in VSCode so I am importing:

from tapo import ApiClient, LightHandler, ColorLightHandler

and my editor now looks like this:
image

However, this happens when I run the code:
image

This is the list of all my imports, I hope this issue isn't related to shadowing or something.

import asyncio
import colorsys
import sys
import TouchPortalAPI as TP
import yaml
from functools import wraps
from typing import Awaitable, Dict, Optional, Tuple, TypeVar, Union
from argparse import ArgumentParser
from TouchPortalAPI.logger import Logger
from tapo import ApiClient, LightHandler, ColorLightHandler

So my questions is, were LightHandler and ColorLightHandler not intented to be imported like this? If so, how to import them?
Thank you kindly for your help pointing me into the right direction.

mihai-dinculescu added a commit that referenced this issue May 20, 2024
@mihai-dinculescu
Copy link
Owner

They were supposed to be exported.
I've just merged a fix to main.

Thank you for reporting this issue!

@alfadormx
Copy link
Author

Thank you for fixing this issue. Has this push to main fixed the package dependency? I mean, to take advantage of this fix, shall I only reinstall the dependency with pip?

@mihai-dinculescu
Copy link
Owner

Not yet. I'll wait a few more days to gather a couple more changes before cutting a new release.
You can build it from source (the git repo) if you want to use it right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants