* Cleanup discovery & add tests
* discovered_devices_raw is not anymore available, as that can be accessed directly from the device objects
* test most of the discovery code paths
* some minor cleanups to test handling
* update discovery docs
* Move category check to be after the definitions
* skip a couple of tests requiring asyncmock not available on py37
* Remove return_raw usage from cli.discover
* Remove bandit from CI, update poetry.lock&pre-commit-config.yaml
* We don't support python 3.6
* poetry install also on tests flow
* remove pytest-azurepipelines
* Avoid temp array during encrypt
* black
* Update kasa/protocol.py
Co-authored-by: Teemu R. <tpr@iki.fi>
* Update kasa/protocol.py
* update decrypt as well
Co-authored-by: Teemu R. <tpr@iki.fi>
* bulb: allow set_hsv without v, add fallback ct range
* add ColorTempRange and HSV named tuples
* add a fallback color temp range if unknown, log a warning
* set_hsv: the value is now optional
* Fix tests, change fallback range to 2700-5000
* test_cli: provide return values to patched objects to avoid warning about non-awaited calls
* test_cli: restore alias after testing
* smartstrip: remove internal update() calls for turn_{on,off}, set_led
* Make sure power is always a float
* Fix discovery tests
* Make tests runnable on real devices
* Add a note about running tests on a real device
* test_strip: run update against the parent device
Some devices are known to fail when trying to query non-supported modules like emeter information.
This commit makes the initial update() only request the sysinfo, followed up by a second query
if emeter is supported by the device.
* Bug Fix
Temperature is not supported on plugs
* Efficiency on support errors
* Update kasa/cli.py
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Teemu R. <tpr@iki.fi>
* Add real kasa KL430(UN) device dump
* Adjust hue&sat max values
* light strips, as bulbs, have only power for emeter
Co-authored-by: Teemu Rytilahti <tpr@iki.fi>
* Add EP10(US) 1.0 1.0.2 fixture
* Add EP10 fixture to conftest PLUGS list.
* Add EP10 to the list of supported plugs in README
* Revert "Add EP10 to the list of supported plugs in README"
This reverts commit e8bf6551c3.
* Prepare 0.4.0.dev3
Most notable changes:
* Devices initialized by discovery are pre-initialized using the discovery response data, so no need for update() directly after discovery
* Only the basic information is requested during discovery, as some HS110 and HS220 devices do not respond to multi-module queries
* Fix mac address parsing for KL430
* Add support for KL125 color temperature ranges
* Documentation updates!
* add types-click for mypy hook
* use generator expression for sum
* Update cli.py
Fix crash when kasa cli is called with --month or --year arguments.
* Update cli.py
* Fix crash on emeter monthly, yearly cli calls
* Formatting fix.
* 'Interface' parameter added to discovery process
Some systems (for example dd-wrt) requires specifying the network interface name, otherwise the broadcast does not work
* 'Interface' variable type and check fixed
* Formatting fixed
* Update kasa/discover.py
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Teemu R. <tpr@iki.fi>
* Preliminary support for light strips
* Add color temperature range and cleanup, thanks to @darkoppressor
* Use lightstrip instead of {led,light}strip consistently everywhere
* The cli flag is now --lightstrip
* add apidocs
* Add fixture file for KL430
Signed-off-by: Kevin Wells <darkoppressor@gmail.com>
* Add discovery support, expose effect and length of the strip
* use set_light_state instead of transition_light_state
* Add tests for lightstrip
* add doctests
* Add KL430 to supported devices in README
Co-authored-by: Kevin Wells <darkoppressor@gmail.com>
* Improve installation instructions
* Add simple instructions how to install the package
* Move the list of supported devices to the end of the file
Fixes#60 (hopefully)
* Remove 'see below for devenv instructions'
* Add ignore_default to lights to allow setting to specific light state, force bulb on when changing the settings, allow defining brightness for set_color_temp, add a couple of new API methods
* Fix and simplify transition_light_state to make tests pass
* Add doctests to SmartBulb
* Add SmartDevice doctests, cleanup README.md
* add doctests for smartplug and smartstrip
* add discover doctests
* Fix bulb mock
* add smartdimmer doctests
* add sphinx-generated docs, cleanup readme a bit
* remove sphinx-click as it does not work with asyncclick
* in preparation for rtd hooking, move doc deps to be separate from dev deps
* pytestmark needs to be applied separately for each and every file, this fixes the tests
* use pathlib for resolving relative paths
* Skip discovery doctest on python3.7
The code is just fine, but some reason the mocking behaves differently between 3.7 and 3.8.
The latter seems to accept a discrete object for asyncio.run where the former expects a coroutine..
* Adds a transition param to set_brightness(), turn_on(), and turn_off() that specifies the duration in milliseconds that the dimmer switch will take to transition to the new state.
* Fixes bug where set_brightness(0) was allowed even though the dimmer does not support it. Now brightness values of 0 are coerced to 1 to be consistent with bulbs (which do support brightness values of 0).