python-kasa/kasa/tests
Teemu R 270614aa02
Revise device initialization and subsequent updates (#807)
This improves the initial update cycle to fetch the information as early
as possible and avoid requesting unnecessary information (like the child
component listing) in every subsequent call of `update()`.

The initial update performs the following steps:
1. `component_nego` (for components) and `get_device_info` (for common
device info) are requested as first, and their results are stored in the
internal state to allow individual modules (like colortemp) to access
the data during the initialization later on.
2. If `child_device` component is available, the child device list and
their components is requested separately to initialize the children.
3. The modules are initialized based on component lists, making the
queries available for the regular `update()`.
4. Finally, a query requesting all module-defined queries is executed,
including also those that we already did above, like the device info.

All subsequent updates will only involve queries that are defined by the
supported modules. This also means that we do not currently support
adding & removing child devices on the fly.

The internal state contains now only the responses for the most recent
update (i.e., no component information is directly available anymore,
but needs to be accessed separately if needed). If component information
is wanted from homeassistant users via diagnostics reports, the
diagnostic platform needs to be adapted to acquire this separately.
2024-03-15 17:18:13 +01:00
..
fixtures Add P100 fw 1.4.0 fixture (#820) 2024-03-12 17:28:50 +01:00
smart Refactor split smartdevice tests to test_{iot,smart}device (#822) 2024-03-15 15:55:48 +00:00
__init__.py mass rename to (python-)kasa (#1) 2019-12-18 09:11:18 +01:00
conftest.py Fix slow aestransport and cli tests (#816) 2024-03-11 10:17:12 +00:00
device_fixtures.py Refactor split smartdevice tests to test_{iot,smart}device (#822) 2024-03-15 15:55:48 +00:00
discovery_fixtures.py Put child fixtures in subfolder (#809) 2024-03-06 15:54:55 +01:00
fakeprotocol_iot.py Refactor test framework (#794) 2024-02-27 18:39:04 +01:00
fakeprotocol_smart.py Refactor test framework (#794) 2024-02-27 18:39:04 +01:00
fixtureinfo.py Fix slow aestransport and cli tests (#816) 2024-03-11 10:17:12 +00:00
test_aestransport.py Fix slow aestransport and cli tests (#816) 2024-03-11 10:17:12 +00:00
test_bulb.py Refactor split smartdevice tests to test_{iot,smart}device (#822) 2024-03-15 15:55:48 +00:00
test_childdevice.py Revise device initialization and subsequent updates (#807) 2024-03-15 17:18:13 +01:00
test_cli.py Fix slow aestransport and cli tests (#816) 2024-03-11 10:17:12 +00:00
test_device_factory.py Add WallSwitch device type and autogenerate supported devices docs (#758) 2024-03-01 18:32:45 +00:00
test_device_type.py Refactor devices into subpackages and deprecate old names (#716) 2024-02-04 16:20:08 +01:00
test_device.py Refactor split smartdevice tests to test_{iot,smart}device (#822) 2024-03-15 15:55:48 +00:00
test_deviceconfig.py Rename and deprecate exception classes (#739) 2024-02-21 16:52:55 +01:00
test_dimmer.py Refactor split smartdevice tests to test_{iot,smart}device (#822) 2024-03-15 15:55:48 +00:00
test_discovery.py Add WallSwitch device type and autogenerate supported devices docs (#758) 2024-03-01 18:32:45 +00:00
test_emeter.py Rename and deprecate exception classes (#739) 2024-02-21 16:52:55 +01:00
test_feature_brightness.py Add iot brightness feature (#808) 2024-03-06 16:45:08 +00:00
test_feature.py Add generic interface for accessing device features (#741) 2024-02-15 16:25:08 +01:00
test_httpclient.py Rename and deprecate exception classes (#739) 2024-02-21 16:52:55 +01:00
test_iotdevice.py Refactor split smartdevice tests to test_{iot,smart}device (#822) 2024-03-15 15:55:48 +00:00
test_klapprotocol.py Retry query on 403 after succesful handshake (#785) 2024-02-22 18:02:03 +01:00
test_lightstrip.py Refactor split smartdevice tests to test_{iot,smart}device (#822) 2024-03-15 15:55:48 +00:00
test_plug.py Refactor split smartdevice tests to test_{iot,smart}device (#822) 2024-03-15 15:55:48 +00:00
test_protocol.py Rename and deprecate exception classes (#739) 2024-02-21 16:52:55 +01:00
test_readme_examples.py Refactor test framework (#794) 2024-02-27 18:39:04 +01:00
test_smartdevice.py Revise device initialization and subsequent updates (#807) 2024-03-15 17:18:13 +01:00
test_smartprotocol.py Support multiple child requests (#795) 2024-02-26 17:13:46 +01:00
test_strip.py Refactor split smartdevice tests to test_{iot,smart}device (#822) 2024-03-15 15:55:48 +00:00
test_usage.py Refactor devices into subpackages and deprecate old names (#716) 2024-02-04 16:20:08 +01:00