I had kasa working on this system months ago. I haven't used it for a few weeks and it appears that unrelated updates cause kasa to fail (No module named 'importlib_metadata' with python3.8). I found a python issue - apparently the underscore changed to a period. I knew kasa was out of date, so I did a pip3 uninstall kasa followed by pip3 install kasa. This fails with
Traceback (most recent call last):
File "/usr/local/bin/kasa", line 5, in
from kasa.cli import cli
File "/usr/local/lib/python3.8/dist-packages/kasa/cli.py", line 61, in
async def cli(ctx, host, alias, target, debug, bulb, plug, lightstrip, strip, type):
File "/usr/local/lib/python3.8/dist-packages/asyncclick/decorators.py", line 304, in decorator
return option(*(param_decls or ("--version",)), **attrs)(f)
File "/usr/local/lib/python3.8/dist-packages/asyncclick/decorators.py", line 192, in decorator
_param_memo(f, OptionClass(param_decls, **option_attrs))
File "/usr/local/lib/python3.8/dist-packages/asyncclick/core.py", line 1750, in init
Parameter.init(self, param_decls, type=type, **attrs)
TypeError: init() got an unexpected keyword argument 'package_name'
This is a regression caused by #286 if you do pip install -U click it should start working (with click >= 8). Alternatively, you can modify that line by removing the package_name.
I upgraded click as rytilahti described and also had to update asyncclick. The I hit the problem is bug #302 when I tested with kasa discover. But testing the KP115 plug with emeter is fine. So I'm closing this; thanks for the hint.
Activity
rytilahti commented on Feb 3, 2022
This is a regression caused by #286 if you do pip install -U click it should start working (with click >= 8). Alternatively, you can modify that line by removing the package_name.
paulvonbehren commented on Feb 4, 2022
I upgraded click as rytilahti described and also had to update asyncclick. The I hit the problem is bug #302 when I tested with kasa discover. But testing the KP115 plug with emeter is fine. So I'm closing this; thanks for the hint.
Release 0.4.2
Release 0.4.2 (#321)
Release 0.4.2 (python-kasa#321)