* Avoid linear search for emeter realtime and emeter_today
Most of the time the data we want is at the end of the
list so we now search backwards to avoid having to
scale all the data and throw most of it away
* more tweaks
* coverage
* coverage
* preen
* coverage
* branch cover
* Pull has_emeter property up to tapodevice base class
This will also use the existence of energy_monitoring in the component_nego query to decide if the device has the service.
* Move emeter related functions to tapodevice
* Remove supported_modules override for now
This should be done in a separate PR, if we want to expose the available components to cli and downstreams
* Dedent extra reqs
* Move extra_reqs initialization
* Fix tests
* Do login entirely within AesTransport
* Remove login and handshake attributes from BaseTransport
* Add AesTransport tests
* Synchronise transport and protocol __init__ signatures and rename internal variables
* Update after review
- Show discovery results for unsupported devices and devices that fail to authenticate.
- Rename `--show-unsupported` to `--verbose`.
- Remove separate `--timeout` parameter from cli discovery so it's not confused with `--timeout` now added to cli command.
- Add tests.
This fixes changing the color for L530:
* If color temp is set on the device, it overrides any hue/sat settings. We override it to zero which seems to work.
* L530 does not allow None/null for brightness, so we avoid passing it on to the device.
* Add KP125M fixture. Enable tapo auth in pytest.
* authentication is not just for tapo
* Use "##MASKEDNAME##" base64 for nickname and ssid.
---------
Co-authored-by: Teemu R. <tpr@iki.fi>
* Add support for tapo light bulbs
* Use TapoDevice for on/off
* Add tapobulbs to discovery
* Add partial support for effects
Activating the effect does not work as I thought it would,
but this implements rest of the interface from SmartLightStrip.
* Add missing __init__ for tapo package
* Make mypy happy
* Add docstrings to make ruff happy
* Implement state_information and has_emeter
* Import tapoplug from kasa.tapo package
* Add tapo L530 fixture
* Enable tests for L530 fixture
* Make ruff happy
* Update fixture filename
* Raise exceptions on invalid parameters
* Return results in a wrapped dict
* Implement set_*
* Reorganize bulbs to iot&smart, fix tests for smarts
* Fix linting
* Fix BULBS_LIGHT_STRIP back to LIGHT_STRIPS
* Add support for TAPO/SMART KLAP and seperate transports from protocols
* Add tests and some review changes
* Update following review
* Updates following review
* Fix dump_devinfo and add discovery_result to json
* Update following review. Do not serialize aliases.
* Delete kasa/tests/fixtures/HS100(UK)_1.0_1.2.6.json
This refactors `Discover.connect_single` by moving device instance construction into a separate device factory module.
New `SmartDevice.connect(host, *, port, timeout, credentials, device_type)` class method replaces the functionality of `connect_single`,
and also now allows constructing device instances without relying on UDP discovery for type discovery if `device_type` parameter is set.
---------
Co-authored-by: Teemu R. <tpr@iki.fi>
* Add support for the new encryption protocol
This adds support for the new TP-Link discovery and encryption
protocols. It is currently incomplete - only devices without
username and password are current supported, and single device
discovery is not implemented.
Discovery should find both old and new devices. When accessing
a device by IP the --klap option can be specified on the command
line to active the new connection protocol.
sdb9696 - This commit also contains 16 later commits from Simon Wilkinson
squashed into the original
* Update klap changes 2023 to fix encryption, deal with kasa credential switching and work with new discovery changes
* Move from aiohttp to httpx
* Changes following review comments
---------
Co-authored-by: Simon Wilkinson <simon@sxw.org.uk>