rgomezjnr/wizcon

Works fine but getting an error

rp1231 opened this issue · 8 comments

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

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

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.

@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

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.

Thanks for the explanation!

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!

@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

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).