This will make --json to output relevant contents even when no command is defined (i.e., when calling 'kasa --host <host> --json' or 'kasa --target <bcast> --json'.
* Basic fix for issue: https://github.com/python-kasa/python-kasa/issues/373
Change usage module get_daystat and get_monthat to return dictionaries of date index: time values as spec'd instead of raw usage data. Output matches emeter module get_daystat and get_monthstat
* Fixed some formatting and lint warnings to comply with black/flake8
Use the new _convert function in emeter for all conversions rather than the one in smartdevice.py
Removed unused function _emeter_convert_emeter_data from smartdevice.py
* Added a first pass test module for testing the new usage conversion function
* Changes based on PR feedback
Tidied up some doc string comments
Added a check for explicit values from conversion function
* Rebase on top of current master, fix docstrings
---------
Co-authored-by: Teemu Rytilahti <tpr@iki.fi>
* adding cli option to delete rule
* resolving black linting issue
* simplifying command name
Co-authored-by: Teemu R. <tpr@iki.fi>
* updating rule filter
Co-authored-by: Teemu R. <tpr@iki.fi>
* Fix type hinting issue with call to click.Choice which takes a Sequence not dictionary. Convert TYPE_TO_CLASS keys to a list to pass in.
* Update kasa/cli.py
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Jules Davis <jules@focalpointvr.com>
Co-authored-by: Teemu R. <tpr@iki.fi>
* Add KP125 test fixture and support note.
Signed-off-by: James Alseth <james@jalseth.me>
* mark KP125 having an emeter
Co-authored-by: Teemu R <tpr@iki.fi>
* Avoid retrying open_connection on unrecoverable errors
- We can retry so hard that we block the event loop
Fixes
```
2022-04-16 22:18:51 WARNING (MainThread) [asyncio] Executing <Task finished name=Task-3576 coro=<open_connection() done, defined at /opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/streams.py:25> exception=ConnectionRefusedError(61, "Connect call failed (192.168.107.200, 9999)") created at /opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py:460> took 1.001 seconds
```
* comment
* Add a note about socket sharing
* Show inherited members for apidocs
* Remove outdated note of emeters not being supported on smartstrips
* Describe emeter and usage modules, add note about NTP for time sync
* Describe lib design and modules
* Bump sphinx version, ignore d001 (line-length) for doc8
* demote energy & usage to 3rd level, promote api for 2nd