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

Works fine but getting an error #6

Open
rp1231 opened this issue Apr 20, 2022 · 8 comments
Open

Works fine but getting an error #6

rp1231 opened this issue Apr 20, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@rp1231
Copy link

rp1231 commented Apr 20, 2022

Hi, this works absolutely fine, but I get an error while executing it via cmd

Exception ignored in: <function wizlight.__del__ at 0x0000025A84156440>
Traceback (most recent call last):
  File "C:\Python310\lib\site-packages\pywizlight\bulb.py", line 781, in __del__
    self.loop.call_soon_threadsafe(self._async_close)
  File "C:\Python310\lib\asyncio\base_events.py", line 795, in call_soon_threadsafe
    self._check_closed()
  File "C:\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000025A84038A60>
Traceback (most recent call last):
  File "C:\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Python310\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Python310\lib\asyncio\base_events.py", line 750, in call_soon
    self._check_closed()
  File "C:\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

Thought I'd post it here just in case.

Thanks

@djacobson
Copy link

djacobson commented Apr 21, 2022

Just curious, what version of pywizlight do you have installed? Mine below... FYI, pywizlight requires Python 3.

$ pip3 show pywizlight
Name: pywizlight
Version: 0.4.16
Summary: A python connector for WiZ light bulbs (e.g SLV Play)
Home-page: https://github.com/sbidy/pywizlight
Author: Stephan Traub
Author-email: sbidy@hotmail.com
License: MIT
Location: /home/pi/src/pywizlight
Requires: asyncio-dgram, click
Required-by: wizcon

@rgomezjnr
Copy link
Owner

I think that error is due to newer versions of Python, as described in sbidy/pywizlight#140. @sbidy created a commit to address this, so I think this should be addressed in an upcoming version of pywizlight.

@rp1231
Copy link
Author

rp1231 commented Apr 21, 2022

@rgomezjnr Glad to hear that!

@djacobson Here is my version of pywizlight

Name: pywizlight
Version: 0.5.13
Summary: A python connector for WiZ light bulbs (e.g SLV Play)
Home-page: https://github.com/sbidy/pywizlight
Author: Stephan Traub
Author-email: sbidy@hotmail.com
License: MIT
Location: c:\python310\lib\site-packages
Requires: click
Required-by: wizcon

Also I noticed that you've used a '$' before the actual command.
Why is that?
I always get this error when I use the $ sign:

$ pip3 show pywizlight
'$' is not recognized as an internal or external command,
operable program or batch file.

I've seen the $ sign before commands in many places but never could figure out what it was for?

Thanks

@rgomezjnr
Copy link
Owner

Also I noticed that you've used a '$' before the actual command.

It's just part of the command prompt. You don't actually enter $ as part of the command in this case.

@rgomezjnr rgomezjnr added the bug Something isn't working label Apr 24, 2022
@rp1231
Copy link
Author

rp1231 commented Apr 24, 2022

Thanks for the explanation!

@vvenkatesh-ML
Copy link

I have been having this issue as well, but in my case, the bulb is not reacting.
The pywizlight version I am using is: 0.5.14 with python 3.7.
Additionally, my buld is A19 - 1.27.0 (23007)
Any help is appreciated!

@rgomezjnr
Copy link
Owner

@vvenkatesh-ML Here's some troubleshooting steps:

  1. Verify the IP address of the bulb, either using your router or the Wiz app on your phone
  2. Try pinging the bulb e.g. ping IP
  3. Try using wizlight command that comes installed with pywizlight e.g. wizlight on

@nickjwhite
Copy link

This issue is still present with the latest wizcon / pywizlight on pip. It doesn't look like anything has been changed in pywizlight - the fix mentioned above was just a documentation change to example code which doesn't seem to make much difference.

A workaround (inspired by this comment on the pywizlight issue) is to add del wizlight.__del__ at the start of the async def main() function. I'm not much of a python programmer so I'm not sure if there is a better way to fix this (I imagine there is).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants