python-kasa/kasa
J. Nick Koston c865d3f02c
Fix unsafe __del__ in TPLinkSmartHomeProtocol (#300)
* Fix unsafe __del__ in TPLinkSmartHomeProtocol

Fixes
```
Exception ignored in: <function TPLinkSmartHomeProtocol.__del__ at 0x1096d0670>
Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/venv/lib/python3.9/site-packages/kasa/protocol.py", line 159, in __del__
    self.writer.close()
  File "/opt/homebrew/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/streams.py", line 353, in close
    return self._transport.close()
  File "/opt/homebrew/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/selector_events.py", line 700, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "/opt/homebrew/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 748, in call_soon
    self._check_thread()
  File "/opt/homebrew/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 785, in _check_thread
    raise RuntimeError(
RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one
```

* comment

* comment

* comment
2022-01-30 23:00:00 +01:00
..
tests Added a fixture file for KS220M (#273) 2022-01-29 18:28:14 +01:00
__init__.py Improve emeterstatus API, move into own module (#205) 2021-09-23 17:58:19 +02:00
cli.py Relax asyncclick version requirement (#286) 2022-01-14 16:32:32 +01:00
discover.py Do not crash on discovery on WSL (#283) 2022-01-08 17:48:01 +01:00
emeterstatus.py Improve emeterstatus API, move into own module (#205) 2021-09-23 17:58:19 +02:00
exceptions.py Add retries to protocol queries (#65) 2020-05-27 20:02:09 +03:00
protocol.py Fix unsafe __del__ in TPLinkSmartHomeProtocol (#300) 2022-01-30 23:00:00 +01:00
py.typed Add py.typed to flag that the package is typed (#251) 2021-11-15 18:21:24 +01:00
smartbulb.py Add KL135 color temperature range (#256) 2021-11-19 18:08:20 +01:00
smartdevice.py Drop microsecond precision for on_since (#296) 2022-01-29 17:02:05 +01:00
smartdimmer.py Add --transition to bulb-specific cli commands, fix turn_{on,off} signatures (#81) 2020-07-06 16:10:28 +02:00
smartlightstrip.py Add support for lightstrips (KL430) (#74) 2020-07-19 22:32:17 +02:00
smartplug.py Add --transition to bulb-specific cli commands, fix turn_{on,off} signatures (#81) 2020-07-06 16:10:28 +02:00
smartstrip.py Add python 3.10 to CI (#279) 2021-12-17 17:48:03 +01:00