Teemu R
cfbdf7c64a
Show discovery data for state with verbose ( #678 )
...
* Show discovery data for state with verbose
* Remove duplicate discovery printout on discovery, add a newline for readability
2024-01-23 13:24:17 +01:00
J. Nick Koston
d5fdf05ed2
Add P100 test fixture ( #683 )
2024-01-23 10:12:24 +00:00
J. Nick Koston
abd3ee0768
Add P135 fixture ( #673 )
...
* Add P135 fixture
This device is a dimmer but we currently treat it as a on/off
* add to conftest
2024-01-23 08:31:19 +01:00
J. Nick Koston
65c47a9373
Update fixtures from test devices ( #679 )
...
* Update fixtures from test devices
* move l920 to another pr
2024-01-23 08:12:54 +01:00
J. Nick Koston
37f522c763
Add L530E(US) fixture ( #674 )
2024-01-23 06:24:08 +01:00
Steven B
ee487ad837
Sleep between discovery packets ( #656 )
...
* Sleep between discovery packets
* Add tests
2024-01-22 18:25:23 +01:00
Steven B
6b0a72d5a7
Add protocol and transport documentation ( #663 )
...
* Add protocol and transport documentation
* Update post review
2024-01-22 17:45:19 +01:00
Steven B
14acc8550e
Rename base TPLinkProtocol to BaseProtocol ( #669 )
2024-01-22 16:28:30 +01:00
Teemu R
df59791829
Add l900-5 1.1.0 fixture ( #664 )
...
* Adds new localSmart module
* Changed from AES to klap
* Doesn't reboot itself when receiving a RST for the cloud connectivity requests
2024-01-21 01:41:13 +01:00
Teemu R
f77e87dc5d
dump_devinfo improvements ( #657 )
...
* dump_devinfo improvements
* Scrub only the last three bytes for mac addresses
* Add --target to allow creating fixtures based on discovery
* Save fixtures directly to correct location, add --basedir to allow defining the location of repository root
* Add --autosave to disable prompting for saving
* Update fixtures for devices I have
* Add fixture for HS110 hw 4.0 fw 1.0.4
* Improve help strings
* Fix tests
* Update devtools README
* Default to discovery if no host/target given
2024-01-20 14:20:08 +01:00
Steven B
49cfef087c
Make close behaviour consistent across new protocols and transports ( #660 )
2024-01-20 13:35:05 +01:00
Steven B
e94cd118a4
Add fixtures with new MAC mask ( #661 )
2024-01-20 13:22:54 +01:00
J. Nick Koston
8523800b23
Fix minor typos in docstrings ( #659 )
2024-01-20 02:40:21 +01:00
J. Nick Koston
d62b5a55cc
Improve and document close behavior ( #654 )
...
* Close connection on smartprotocol timeout
* tweaks
2024-01-19 21:30:01 +01:00
Steven B
38159140fb
Fix httpclient exceptions on read and improve error info ( #655 )
2024-01-19 21:06:50 +01:00
Steven B
bedf05ce3b
Remove time logging in debug message ( #645 )
2024-01-18 08:32:58 -10:00
Steven B
c3329155c8
Raise SmartDeviceException on invalid config dicts ( #640 )
...
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-01-18 07:51:50 -10:00
Steven B
642e9a1f5b
Migrate http client to use aiohttp instead of httpx ( #643 )
2024-01-18 07:32:26 -10:00
Steven B
3b1b0a3c21
Encapsulate http client dependency ( #642 )
...
* Encapsulate http client dependency
* Store cookie dict as variable
* Update post-review
2024-01-18 10:57:33 +01:00
J. Nick Koston
eadf1203fc
Add fixture for L920 ( #638 )
2024-01-14 23:49:31 +01:00
J. Nick Koston
aed67dad16
Fix connection indeterminate state on cancellation ( #636 )
...
* Fix connection indeterminate state on cancellation
If the task the query is running in it cancelled, we do
know the state of the connection so we must close. Previously
we would not close on BaseException which could result
in reading the previous response if the previous query was
cancelled after the request had been sent
* add test for cancellation
2024-01-13 18:37:24 +01:00
Steven B
fbce755544
Raise TimeoutException on discover_single timeout ( #632 )
2024-01-11 16:13:44 +01:00
Steven B
5b8280a8d9
Return alias as None for new discovery devices before update ( #627 )
...
* Trim the length of the unavailable device alias
* Update to use short mac as auth required alias
* Update to return alias as none
2024-01-11 16:12:02 +01:00
Steven B
fd2170c82c
Update config to_dict to exclude credentials if the hash is empty string ( #626 )
...
* Update config to_dict to exclude credentials if the hash is empty string
* Add test
2024-01-10 20:47:30 +01:00
Steven B
d5a6fd8e73
Improve test coverage ( #625 )
2024-01-10 20:37:43 +01:00
Steven B
3e0cd07b7c
Update docs for newer devices and DeviceConfig ( #614 )
...
* Update docs for newer devices and DeviceConfig
* Tweak docs post review
* Move sentence to newline
* Update post review
* Update following review
2024-01-10 20:13:14 +01:00
Steven B
897db674c2
Add L900-10 fixture and it's additional component requests ( #629 )
2024-01-10 19:40:36 +01:00
J. Nick Koston
460054ced7
Avoid recreating struct each request in legacy protocol ( #628 )
2024-01-09 13:51:04 -10:00
Nathan Wreggit
cfe694e5de
Get child emeters with CLI ( #623 )
...
* Get child emeters with CLI
* Avoid extra IO when not que querying the child emeter
2024-01-05 02:25:24 +01:00
Teemu R
2d8a8d9511
Add update-credentials command ( #620 )
...
* Add change credentials command
* Rename command and add prompts for credential update
2024-01-05 02:25:15 +01:00
J. Nick Koston
554fe0a96e
Avoid linear search for emeter realtime and emeter_today ( #622 )
...
* 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
2024-01-05 02:01:00 +01:00
J. Nick Koston
efd67b9261
Add P125M and update EP25 fixtures ( #621 )
...
* Add P125M and update EP25 fixtures
* fix: adjust tests
2024-01-05 00:01:34 +01:00
Teemu R
17d96064c2
Mark L900-5 as supported ( #617 )
...
* Add fixture for L900-5
* Update readme
2024-01-04 19:52:11 +01:00
Teemu R
7a3eedeee9
Check the ct range for color temp support ( #619 )
2024-01-04 19:28:48 +01:00
sdb9696
b156defc3c
Fix cli discover bug with None username/password ( #615 )
2024-01-04 19:17:48 +01:00
sdb9696
e9bf9f58ee
Allow serializing and passing of credentials_hashes in DeviceConfig ( #607 )
...
* Allow passing of credentials_hashes in DeviceConfig
* Update following review
2024-01-03 22:46:08 +01:00
Teemu R
3692e4812f
Implement wifi interface for tapodevice ( #606 )
...
* Implement wifi interface for tapodevice
* Implement wifi_join
Tested to work on P110
* Fix linting
2024-01-03 22:45:16 +01:00
gimpy88
c810298b04
Add support for KS205 and KS225 wall switches ( #594 )
...
* KS205 Fixture
* KS225 Fixture
* Added Smart.KasaSwitch device type
* Added KS225 to test
* Added variable color temp check
* Added supported devices to readme
* Removed parenthesis
* Updated fixtures
* Fixed for ruff
2024-01-03 19:31:42 +01:00
Teemu R
30c4e6a6a3
Cleanup credentials handling ( #605 )
...
* credentials: don't allow none to simplify checks
* Implement __bool__ for credentials
* Cleanup klaptransport cred usage
* Cleanup deviceconfig and tapodevice
* fix linting
* Pass dummy credentials for tests
* Remove __bool__ dunder and add docs to credentials
* Check for cred noneness in tapodevice.update()
2024-01-03 19:26:52 +01:00
Teemu R
10fc2c3c54
Pull up emeter handling to tapodevice base class ( #601 )
...
* 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
2024-01-03 19:04:34 +01:00
Teemu R
864ea92ece
Update P110(EU) fixture ( #604 )
2024-01-02 19:34:39 +01:00
Teemu R
9a2b513e6a
Update L530 aes fixture ( #603 )
2024-01-02 18:49:52 +01:00
Teemu R
5dafc1d1ed
Cleanup custom exception kwarg handling ( #602 )
...
* Cleanup custom exceptions
* Read custom keyword arguments from kwargs
* Pass all input args to the super
Earlier behavior:
Got error: AuthenticationException((('Error logging in: 192.168.xx.xx: LOGIN_ERROR(-1501)',), <SmartErrorCode.LOGIN_ERROR: -1501>))
New behavior:
Got error: AuthenticationException('Error logging in: 192.168.xx.xx: LOGIN_ERROR(-1501)')
* Pass UnsupportedDeviceException kwargs to parent, too
2024-01-02 16:24:09 +01:00
sdb9696
7646bc4542
Update P110(UK) fixture ( #596 )
2023-12-31 15:36:15 +01:00
sdb9696
fd9b3cd04c
Add L530(EU) klap fixture ( #598 )
2023-12-31 15:35:43 +01:00
sdb9696
1b7914277d
Fix dump_devinfo for unauthenticated ( #593 )
2023-12-29 20:42:02 +01:00
sdb9696
f6fd898faf
Add DeviceConfig to allow specifying configuration parameters ( #569 )
...
* Add DeviceConfig handling
* Update post review
* Further update post latest review
* Update following latest review
* Update docstrings and docs
2023-12-29 20:17:15 +01:00
Teemu R
1d5a9c35f4
Elevate --verbose to top-level option ( #590 )
...
* Elevate --verbose to be usable for all commands
* Fix tests
2023-12-29 16:04:41 +01:00
sdb9696
b66347116f
Add optional error code to exceptions ( #585 )
2023-12-20 20:16:23 +01:00
sdb9696
6819c746d7
Enable multiple requests in smartprotocol ( #584 )
...
* Enable multiple requests in smartprotocol
* Update following review
* Remove error_code parameter in exceptions
2023-12-20 18:08:04 +01:00