Commit Graph

101 Commits

Author SHA1 Message Date
Teemu R.
5b8447c940 Prepare 0.11.0 (#1776)
## [0.11.0](https://github.com/python-kasa/python-kasa/tree/0.11.0)
(2026-10-04)

[Full
Changelog](https://github.com/python-kasa/python-kasa/compare/0.10.2...0.11.0)

**Release summary:**

This is a huge and long overdue release, coming more than a year and a
half after the previous one.
Hopefully the next one follows sooner, as the TPAP transport (which did
not make it into this release) is used more and more on newer devices.

This release brings broader camera support, new modules for lights,
vacuums and cameras, and many connectivity fixes for newer firmware
versions. Some other highlights:
- Improved Tapo camera support: login version 3, presets, wifi handling,
last alert detection, and more robust authentication and discovery.
- Selective room cleaning for robot vacuums.
- Configurable light strip length via the new strip segment module, and
an exposed light transition state change flag.
- Basic HomeKit module for Kasa (iot) devices.
- Energy monitoring V2 support (S515D).
- Better hub and thermostat state reporting (hold, summer mode, low
battery).
- Connection fixes for newer Tapo firmware and older SSL devices, plus
KLAP v2 for iot devices.
- More resilient time handling, with failover and UTC fallback for iot
devices.
- Python 3.14 is now supported.
- Inclusion of fixtures for 29 devices or firmware versions, including
the Tapo C460, C200 and C101 cameras and the KH100 hub with KE100/KE110
thermostats.

**Thank you to all contributors!**

A big thank you to everyone who contributed to this release, whether
through code, device fixtures, bug reports or testing.

Special thanks to @ZeliardM for a huge effort on both features and
project maintenance, including but not limited to:
- Features like the HomeKit module for iot devices, iot time module
failover, wifi handling and credential improvements for cameras, Tapo
login version 3, and V2 energy monitoring for S515D.
- A lot of necessary maintenance work including type annotations and
cleanups throughout the test suite, modernized docstrings, CI hardening
with SHA-pinned actions, and many bug fixes. This helps us to keep the
library maintainable and open to new contributions.

A warm welcome to our new contributors, with special thanks to those who
contributed improvements and fixes:
- @alams154: discovery on port 20004
- @bluntman001: iot device classification fix
- @bm1549: KLAP v2 transport for iot devices
- @darylldelfin: cipher support for newer Tapo firmware
- @davidefiocco: vacuum mop water level fix
- @epg-pers: selective room cleaning for vacuums
- @freeKC: camera discovery and authentication fixes
- @gpongelli: extended camera detection
- @Ikstar: KL420 color temperature range
- @juherr: last alert detection module for cameras, camera error codes
and a C200 fixture
- @kad: SSL connections to older devices
- @KaloyanNaumov: multi-request timeout handling
- @loganrosen: KL400L5 color temperature range
- @markvanpraet: Tapo C460 support and camera battery fix
- @monteccarlos: iot timezone mapping fix
- @mrwogu: preset support for Tapo cameras
- @nopoz: strip segment module, light transition flag and credentials
hash fix
- @tk1475: UTC fallback for unset iot device clocks
- @wh1t3f1r3: non-retryable network error handling

Thanks also to our new contributors who provided device fixtures to help
future development efforts: @emanueleg, @fantandrea, @HarryPehkonen,
@ijaron, @Krotu, @LostLuma, @mjbohr and @TheLinuxGuy.

**This release in numbers:**

- 68 merged pull requests from 29 contributors, 27 of them first-time
contributors
- 8 new modules
- 29 new device fixtures
- 203 files changed, with 25,199 lines added and 2,585 removed


**Implemented enhancements:**

- \[Feature Request\] C220 camera line crossing detection on-off switch
[\#1551](https://github.com/python-kasa/python-kasa/issues/1551)
- SslAesTransport: handshake again when a camera answers 401 to
passthrough
[\#1771](https://github.com/python-kasa/python-kasa/pull/1771) (@freeKC)
- Add LastAlertDetection module for smartcam devices
[\#1762](https://github.com/python-kasa/python-kasa/pull/1762) (@juherr)
- Add KL420 to TPLINK\_KELVIN color temperature ranges
[\#1757](https://github.com/python-kasa/python-kasa/pull/1757) (@Ikstar)
- Do not authenticate with a credentials\_hash from a different
transport [\#1749](https://github.com/python-kasa/python-kasa/pull/1749)
(@nopoz)
- Expose the light transition state change flag
[\#1745](https://github.com/python-kasa/python-kasa/pull/1745) (@nopoz)
- Add strip segment module for configurable light strip length
[\#1744](https://github.com/python-kasa/python-kasa/pull/1744) (@nopoz)
- Add KL400L5 color temperature range
[\#1719](https://github.com/python-kasa/python-kasa/pull/1719)
(@loganrosen)
- Update smartcam credential handling and tests
[\#1664](https://github.com/python-kasa/python-kasa/pull/1664)
(@ZeliardM)
- Add support for V2 Energy Monitoring for S515D
[\#1663](https://github.com/python-kasa/python-kasa/pull/1663)
(@ZeliardM)
- Add selective room cleaning to vacuum clean module
[\#1660](https://github.com/python-kasa/python-kasa/pull/1660)
(@epg-pers)
- New Wi-Fi handling for SMARTCAM devices
[\#1639](https://github.com/python-kasa/python-kasa/pull/1639)
(@ZeliardM)
- Add support for tapo login\_version 3 in sslaestransport
[\#1638](https://github.com/python-kasa/python-kasa/pull/1638)
(@ZeliardM)
- Add preset support for Tapo cameras
[\#1615](https://github.com/python-kasa/python-kasa/pull/1615) (@mrwogu)
- Add python 3.14 to supported versions
[\#1599](https://github.com/python-kasa/python-kasa/pull/1599)
(@rytilahti)
- Add discovery port 20004
[\#1595](https://github.com/python-kasa/python-kasa/pull/1595)
(@alams154)
- Implement IOT Time Module Failover
[\#1583](https://github.com/python-kasa/python-kasa/pull/1583)
(@ZeliardM)
- Add bare bones homekit module for iot devices
[\#1566](https://github.com/python-kasa/python-kasa/pull/1566)
(@ZeliardM)
- Extend smartcam detection support
[\#1552](https://github.com/python-kasa/python-kasa/pull/1552)
(@gpongelli)

**Fixed bugs:**

- Time module unavailable for waterleak sensor
[\#1613](https://github.com/python-kasa/python-kasa/issues/1613)
- 'No time zone found with key EST' in debian 13
[\#1579](https://github.com/python-kasa/python-kasa/issues/1579)
- Discovery: accept cameras that only send the encrypt\_type list
[\#1770](https://github.com/python-kasa/python-kasa/pull/1770) (@freeKC)
- Classify IOT devices via sysinfo regardless of transport \(fixes
\#1740\) [\#1769](https://github.com/python-kasa/python-kasa/pull/1769)
(@bluntman001)
- Fall back to UTC for iot time when the device clock is not set
[\#1768](https://github.com/python-kasa/python-kasa/pull/1768) (@tk1475)
- Add UNKNOWN\_USERNAME \(-60502\) camera error code
[\#1761](https://github.com/python-kasa/python-kasa/pull/1761) (@juherr)
- Disable multi requests on timeout during multi-request
[\#1759](https://github.com/python-kasa/python-kasa/pull/1759)
(@KaloyanNaumov)
- Add ECDHE-RSA-AES256 cipher for newer Tapo firmware
[\#1755](https://github.com/python-kasa/python-kasa/pull/1755)
(@darylldelfin)
- Map iot timezone index 18 to America/New\_York instead of EST
[\#1743](https://github.com/python-kasa/python-kasa/pull/1743)
(@monteccarlos)
- fix: use KLAP v2 transport for IOT devices with login version 2
[\#1731](https://github.com/python-kasa/python-kasa/pull/1731) (@bm1549)
- Add ENETUNREACH to non-retryable errors in XorTransport
[\#1668](https://github.com/python-kasa/python-kasa/pull/1668)
(@wh1t3f1r3)
- Fix mop set\_waterlevel sending setCleanAttr without type field
[\#1667](https://github.com/python-kasa/python-kasa/pull/1667)
(@davidefiocco)
- Fix SMARTCAM Time module and update tests
[\#1659](https://github.com/python-kasa/python-kasa/pull/1659)
(@ZeliardM)
- Fix camera login version in CLI
[\#1658](https://github.com/python-kasa/python-kasa/pull/1658)
(@ZeliardM)
- Allow SSL connections to older devices
[\#1654](https://github.com/python-kasa/python-kasa/pull/1654) (@kad)
- waterleaksensor: use parent's Time for alert timestamp
[\#1614](https://github.com/python-kasa/python-kasa/pull/1614)
(@rytilahti)
- Add hold state to thermostatstate
[\#1609](https://github.com/python-kasa/python-kasa/pull/1609)
(@rytilahti)
- Fix thermostat idle reporting on low battery
[\#1598](https://github.com/python-kasa/python-kasa/pull/1598)
(@rytilahti)
- Add shutdown \(summer mode\) to thermostatstate
[\#1588](https://github.com/python-kasa/python-kasa/pull/1588)
(@rytilahti)
- Fix iotstrip child device time handling
[\#1584](https://github.com/python-kasa/python-kasa/pull/1584)
(@ZeliardM)

**Added support for devices:**

- Add C200 device fixture
[\#1760](https://github.com/python-kasa/python-kasa/pull/1760) (@juherr)
- Add P125M fixture for firmware 1.4.4
[\#1746](https://github.com/python-kasa/python-kasa/pull/1746)
(@HarryPehkonen)
- Add fixtures for KH100, KE100 and KE110 and simulate TRV states
[\#1726](https://github.com/python-kasa/python-kasa/pull/1726) (@Krotu)
- Add L530EA\(EU\) device fixture
[\#1694](https://github.com/python-kasa/python-kasa/pull/1694)
(@ZeliardM)
- Add C101 test fixture
[\#1673](https://github.com/python-kasa/python-kasa/pull/1673) (@ijaron)
- Add LB130\(US\) device fixture
[\#1669](https://github.com/python-kasa/python-kasa/pull/1669)
(@ZeliardM)
- Add KL110B\(UN\) device fixture
[\#1657](https://github.com/python-kasa/python-kasa/pull/1657)
(@ZeliardM)
- Add TS15\(US\) device fixture
[\#1649](https://github.com/python-kasa/python-kasa/pull/1649)
(@ZeliardM)
- Add Tapo C460 support
[\#1645](https://github.com/python-kasa/python-kasa/pull/1645)
(@markvanpraet)
- Add P105\(US\) device fixture
[\#1644](https://github.com/python-kasa/python-kasa/pull/1644)
(@ZeliardM)
- Add L430C\(EU\) device fixture
[\#1643](https://github.com/python-kasa/python-kasa/pull/1643)
(@ZeliardM)
- Add L430P\(EU\) device fixture
[\#1607](https://github.com/python-kasa/python-kasa/pull/1607)
(@LostLuma)
- Add S500\(US\)\_1.0\_1.2.0 fixture
[\#1569](https://github.com/python-kasa/python-kasa/pull/1569)
(@ZeliardM)
- Add device fixture for P316M\(US\)
[\#1568](https://github.com/python-kasa/python-kasa/pull/1568)
(@TheLinuxGuy)
- Add L535E\(EU\) 3.0 1.1.8 fixture
[\#1545](https://github.com/python-kasa/python-kasa/pull/1545)
(@fantandrea)
- Adding KL400L10\(US\)\_1.0\_1.0.10 fixture
[\#1539](https://github.com/python-kasa/python-kasa/pull/1539) (@mjbohr)
- Add TP10\(IT\) 1.0 1.2.5 fixture
[\#1538](https://github.com/python-kasa/python-kasa/pull/1538)
(@emanueleg)
- Add LB100\(US\)\_1.0\_1.8.11 fixture file
[\#1515](https://github.com/python-kasa/python-kasa/pull/1515)
(@ZeliardM)
- Add KS225\(US\)\_1.0\_1.1.1 and L930-5\(EU\)\_1.0\_1.2.5
[\#1509](https://github.com/python-kasa/python-kasa/pull/1509)
(@ZeliardM)

**Documentation updates:**

- How to hash credentials to make use of --credentials-hash flag?
[\#1517](https://github.com/python-kasa/python-kasa/issues/1517)
- docs: modernize docstrings across the repository
[\#1682](https://github.com/python-kasa/python-kasa/pull/1682)
(@ZeliardM)
- Add a note to emeter guide being kasa-only
[\#1512](https://github.com/python-kasa/python-kasa/pull/1512)
(@rytilahti)

**Project maintenance:**

- tests: add type annotations to top-level test files
[\#1688](https://github.com/python-kasa/python-kasa/pull/1688)
(@ZeliardM)
- tests: add type annotations to CLI, protocol, and smartcam tests
[\#1687](https://github.com/python-kasa/python-kasa/pull/1687)
(@ZeliardM)
- tests: add type annotations to Smart tests
[\#1686](https://github.com/python-kasa/python-kasa/pull/1686)
(@ZeliardM)
- tests: add type annotations to IoT tests
[\#1685](https://github.com/python-kasa/python-kasa/pull/1685)
(@ZeliardM)
- tests: add type annotations to transport tests
[\#1684](https://github.com/python-kasa/python-kasa/pull/1684)
(@ZeliardM)
- tests: centralize transport and session cleanup in conftest
[\#1683](https://github.com/python-kasa/python-kasa/pull/1683)
(@ZeliardM)
- ci: pin all GitHub Actions to SHA hashes and update versions
[\#1681](https://github.com/python-kasa/python-kasa/pull/1681)
(@ZeliardM)
- tests: fix typos, child device subtype, CLI patch path, and
deprecation test logic
[\#1677](https://github.com/python-kasa/python-kasa/pull/1677)
(@ZeliardM)
- Update GitHub Workflows and Actions
[\#1622](https://github.com/python-kasa/python-kasa/pull/1622)
(@ZeliardM)
- Use log-level debug for smartdevice query error reporting
[\#1587](https://github.com/python-kasa/python-kasa/pull/1587)
(@rytilahti)
- Use Device instead of SmartDevice where feasible
[\#1585](https://github.com/python-kasa/python-kasa/pull/1585)
(@ZeliardM)

**Closed issues:**

- Python 3.14 Support
[\#1597](https://github.com/python-kasa/python-kasa/issues/1597)
- HS300 Child State - Time Module Error
[\#1445](https://github.com/python-kasa/python-kasa/issues/1445)
2026-10-04 20:03:52 +02:00
Ahmed Hassan
9030179aad Fall back to UTC for iot time when the device clock is not set (#1768)
A new or factory-reset iot device can report a clock far in the past,
e.g. year 2000, which causes a failure in timezone autodetection
logic as the difference can be in years.

This causes `update()` to fail, so every cli command fails, including
`wifi scan` and `wifi join`, which are the commands needed to provision
the device.

To fix this, this changes the logic fall back to UTC if the device clock is not set,
detected by checking if the timedelta is too large.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-04 15:52:54 +02:00
monteccarlos
4c2ef506bd Map iot timezone index 18 to America/New_York instead of EST (#1743)
Iot firmware timezone index 18 corresponds to "(UTC-05:00) Eastern Time (US & Canada)", which observes daylight saving time. 
Previously, this was mapped to a fixed UTC-5 (EST= causing one hour off for New York local times.

Co-authored-by: monteccarlos <vld@noise.xyz>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-18 16:36:33 +02:00
Peter Arapov
7164ef7a66 Add KL420 to TPLINK_KELVIN color temperature ranges (#1757)
Adds the `KL420` series to `TPLINK_KELVIN` to support wider color temperature ranges (2500-9000K as supported by the device).
While older firmware (1.0.2) reported is_variable_color_temp: 0, firmware 1.0.7 enables variable color temperature support.
2026-09-18 15:38:08 +02:00
Logan Rosen
a29d0610ba Add KL400L5 color temperature range (#1719)
Some checks failed
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
Stale / stale (push) Has been cancelled
- add the KL400L5 color temperature range used by newer firmware
- add a KL400L5(US) 1.0.11 fixture that reports variable color
temperature support
- categorize that fixture as variable color temperature while keeping
older KL400L5 fixtures non-variable
- The Tapo app exposes 2500K-9000K for these KL400L5 strips, so this PR
uses that app-visible range.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-18 16:02:57 +02:00
Teemu R.
8840fc395e Add python 3.14 to supported versions (#1599)
* Add python 3.14 to our supported versions and to our CI
* Convert to use pyproject.toml standard dependency groups
* Fix any issues reported by CI
2026-07-07 20:46:57 +02:00
ZeliardM
bb27a43027 docs: modernize docstrings across the repository (#1682)
Comprehensive docstring cleanup across the repository — fix Sphinx
cross-references, Python REPL continuation syntax, stale class names,
and modernize the IotBulb docstring to use the
`Module.Light`/`Module.LightPreset` interface.
2026-07-05 18:30:01 +02:00
ZeliardM
932f3e21e0 Implement IOT Time Module Failover (#1583)
Some checks failed
CI / Perform Lint Checks (3.13) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
Stale / stale (push) Has been cancelled
Adds a failover in the IOT Time Module to handle issues where
the system default time zone files don't have the correct time zone
info.
2026-02-22 19:57:23 +01:00
ZeliardM
30a8fd45a8 New Wi-Fi handling for SMARTCAM devices (#1639)
Some checks failed
CI / Perform Lint Checks (3.13) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
Updated scanning and joining Wi-Fi for SMARTCAM devices that may use a
newer connection process.
2026-02-22 00:03:52 +01:00
ZeliardM
29007e1079 Fix iotstrip child device time handling (#1584)
Some checks failed
CI / Perform linting checks (3.13) (push) Has been cancelled
CodeQL checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
Stale / stale (push) Has been cancelled
This fixes the time handling of the child devices for iotstrip to
pull from the parent device time module instead of having each child
with its own time module.
2025-10-31 21:32:13 +01:00
ZeliardM
0f6fc9c4d1 Add bare bones homekit module for iot devices (#1566)
Based on the existing smart HomeKit module, this has been tested with a real device that supports this module.


---------

Co-authored-by: Teemu Rytilahti <tpr@iki.fi>
2025-10-10 16:45:16 +02:00
Teemu R.
668e32d3a5 Do not crash on missing build number in fw version (#1500)
Some checks failed
CI / Perform linting checks (3.13) (push) Has been cancelled
CodeQL checks / Analyze (python) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.11) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.12) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.13) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.11) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.12) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.13) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.11) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.12) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.13) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.11) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.12) (push) Has been cancelled
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.13) (push) Has been cancelled
Stale / stale (push) Has been cancelled
Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
2025-02-10 11:13:01 +00:00
Ryan Nitcher
bff5409d22 Add Dimmer Configuration Support (#1484) 2025-02-02 13:48:34 +00:00
Steven B.
82fbe1226e Do not return empty string for custom light effect name (#1491) 2025-01-29 18:49:06 +00:00
Ryan Nitcher
7f2a1be392 Add ADC Value to PIR Enabled Switches (#1263)
Some checks are pending
CI / Perform linting checks (3.13) (push) Waiting to run
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.13) (push) Blocked by required conditions
CodeQL checks / Analyze (python) (push) Waiting to run
2025-01-25 10:45:48 +00:00
Steven B.
9b7bf367ae Update ruff to 0.9 (#1482)
Some checks are pending
CI / Perform linting checks (3.13) (push) Waiting to run
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.13) (push) Blocked by required conditions
CodeQL checks / Analyze (python) (push) Waiting to run
Ruff 0.9 contains a number of formatter changes for the 2025 style guide.
Update to `ruff>=0.9.0` and apply the formatter fixes.
https://astral.sh/blog/ruff-v0.9.0
2025-01-24 10:53:27 +00:00
Nathan Wreggit
b701441215 Fix iot strip turn on and off from parent (#639)
Some checks are pending
CI / Perform linting checks (3.13) (push) Waiting to run
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.13) (push) Blocked by required conditions
CodeQL checks / Analyze (python) (push) Waiting to run
Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
2025-01-23 15:05:38 +00:00
Steven B.
fa0f7157c6 Deprecate legacy light module is_capability checks (#1297)
Deprecate the `is_color`, `is_dimmable`, `is_variable_color_temp`, `valid_temperate_range`,
and `has_effects` attributes from the `Light` module, as consumers should use
`has_feature("hsv")`, `has_feature("brightness")`, `has_feature("color_temp")`,
`get_feature("color_temp").range`, and `Module.LightEffect in dev.modules` respectively.

Calling the deprecated attributes will emit a `DeprecationWarning`
and type checkers will fail them.
2025-01-22 10:26:37 +00:00
Steven B.
223f3318ea Use DeviceInfo consistently across devices (#1338)
Some checks are pending
CI / Perform linting checks (3.13) (push) Waiting to run
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.13) (push) Blocked by required conditions
CodeQL checks / Analyze (python) (push) Waiting to run
- Make model exclude region for `iot` devices. This is consistent with `smart` and `smartcam` devices.
- Make region it's own attribute on `Device`.
- Ensure that devices consistently use `_get_device_info` static methods for all information relating to device models.
- Fix issue with firmware and hardware being the wrong way round for `smartcam` devices.
2024-12-13 12:37:13 +00:00
Steven B.
7709bb967f Update cli, light modules, and docs to use FeatureAttributes (#1364)
Some checks are pending
CI / Perform linting checks (3.13) (push) Waiting to run
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.13) (push) Blocked by required conditions
CodeQL checks / Analyze (python) (push) Waiting to run
2024-12-11 15:53:35 +00:00
Puxtril
cb89342be1 Add LinkieTransportV2 and basic IOT.IPCAMERA support (#1270)
Add LinkieTransportV2 transport used by kasa cameras and a basic
implementation for IOT.IPCAMERA (kasacam) devices.

---------

Co-authored-by: Zach Price <pricezt@ornl.gov>
Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
Co-authored-by: Teemu Rytilahti <tpr@iki.fi>
2024-12-07 00:06:58 +01:00
Steven B.
cae9decb02 Exclude __getattr__ for deprecated attributes from type checkers (#1294) 2024-11-21 18:40:13 +00:00
Steven B.
f7778aaa53 Migrate RuleModule to mashumaro (#1283)
Also fixes a bug whereby multiple queries for the same module would overwrite each other.
2024-11-20 14:59:32 +00:00
Steven B.
955e7ab4d0 Migrate TurnOnBehaviours to mashumaro (#1285) 2024-11-20 15:35:51 +01:00
Steven B.
5eca487bcb Migrate iot cloud module to mashumaro (#1282)
Breaking change as the CloudInfo interface is changing to snake case for
consistency with the rest of the library.
2024-11-20 14:34:26 +01:00
Steven B.
03c073c293 Migrate IotLightPreset to mashumaru (#1275) 2024-11-20 08:37:04 +00:00
Steven B.
a01247d48f Remove support for python <3.11 (#1273)
Python 3.11 ships with latest Debian Bookworm. 
pypy is not that widely used with this library based on statistics. It could be added back when pypy supports python 3.11.
2024-11-18 18:46:36 +00:00
Steven B.
e209d40a6d Use _get_device_info methods for smart and iot devs in devtools (#1265) 2024-11-18 14:53:11 +00:00
Steven B.
9d46996e9b Fix repr for device created with no sysinfo or discovery info" (#1266)
Co-authored-by: Teemu R. <tpr@iki.fi>
2024-11-18 13:14:39 +00:00
Steven B.
e55731c110 Move protocol modules into protocols package (#1254) 2024-11-13 17:50:21 +00:00
Steven B.
71ae06fa83 Fix test framework running against real devices (#1235) 2024-11-11 17:41:31 +00:00
Teemu R.
66eb17057e Enable ruff check for ANN (#1139) 2024-11-10 18:55:13 +00:00
Teemu R.
b2f3971a4c Add PIR&LAS for wall switches mentioning PIR support (#1227)
Some devices (like KS200M) support ambient and motion, but as they are
detected as wall switches, they don't get the modules added.
This PR enables the respective modules for wall switches when the
`dev_name` contains `PIR`.
2024-11-03 16:45:48 +01:00
Teemu R.
5da41fcc11 Use stacklevel=2 for warnings to report on callsites (#1219)
Use stacklevel=2 for warnings, as this will correctly show the callsite
instead of the line where the warning is reported.

Currently:
```
kasa/__init__.py:110
  /home/tpr/code/python-kasa/kasa/__init__.py:110: DeprecationWarning: SmartDevice is deprecated, use IotDevice from package kasa.iot instead or use Discover.discover_single() and Device.connect() to support new protocols
    warn(
```

After:
```
kasa/tests/smart/modules/test_contact.py:3
  /home/tpr/code/python-kasa/kasa/tests/smart/modules/test_contact.py:3: DeprecationWarning: SmartDevice is deprecated, use IotDevice from package kasa.iot instead or use Discover.discover_single() and Device.connect() to support new protocols
    from kasa import Module, SmartDevice

``` 

Currently:
```
kasa/tests/test_lightstrip.py: 56 warnings
  /home/tpr/code/python-kasa/kasa/device.py:559: DeprecationWarning: effect is deprecated, use: Module.LightEffect in device.modules instead
    warn(msg, DeprecationWarning, stacklevel=1)
```

After:
```
kasa/tests/test_lightstrip.py::test_effects_lightstrip_set_effect_transition[500-KL430(US)_2.0_1.0.9.json]
  /home/tpr/code/python-kasa/kasa/tests/test_lightstrip.py:62: DeprecationWarning: set_effect is deprecated, use: Module.LightEffect in device.modules instead
    await dev.set_effect("Candy Cane")
```
2024-10-31 14:12:17 +01:00
Teemu R.
6c141c3b65 Expose ambient light setting for iot dimmers (#1210)
This PR adds a setting to control the ambient light enabled/disabled.

Also fixes the getters.
2024-10-31 12:17:18 +01:00
Teemu R.
9975bbf26a Expose PIR enabled setting for iot dimmers (#1174)
This adds PIR enabled feature to iot dimmers, making it possible to
enable and disable the motion detection.
2024-10-31 10:41:11 +00:00
Steven B.
673a32258f Make HSV NamedTuple creation more efficient (#1211) 2024-10-29 17:14:52 +00:00
Steven B.
7fd8c14c1f Create common Time module and add time set cli command (#1157) 2024-10-15 08:59:25 +01:00
Steven B.
bd5a24b0ed Use tzinfo in time constructor instead of astime for iot devices (#1158)
Fixes using `astime` on a non tzinfo aware object which causes issues with daylight saving.
2024-10-08 12:33:19 +01:00
Steven B.
7c1686d3ae Cache zoneinfo for smart devices (#1156) 2024-10-08 12:21:01 +01:00
Steven B.
9641edcbc0 Make iot time timezone aware (#1147)
Also makes on_since for iot devices use device time.
Changes the return value for device.timezone to be tzinfo instead of a dict.
2024-10-08 08:16:51 +01:00
Steven B.
1fcf3e44c2 Stabilise on_since value for smart devices (#1144)
Caches the `on_since` value to prevent jitter caused by the device calculations.
2024-10-02 15:04:16 +01:00
Steven B.
81e2685605 Send empty dictionary instead of null for iot queries (#1145) 2024-10-01 12:47:36 +01:00
Teemu R.
d897503b58 Move feature initialization from __init__ to _initialize_features (#1140) 2024-09-28 20:14:31 +02:00
Teemu R.
1ce5af2494 Add factory_reset() to iotdevice (#1125)
Also extend the base device class API to make factory_reset() part of the common API.
2024-09-27 17:42:22 +01:00
Teemu R.
73b6d16074 Extend KL135 ct range up to 9000K (#1123) 2024-09-21 16:29:25 +01:00
Teemu R.
6a86ffbbba Add flake8-pytest-style (PT) for ruff (#1105)
This will catch common issues with pytest code.

* Use `match` when using `pytest.raises()` for base exception types like
`TypeError` or `ValueError`
* Use tuples for `parametrize()`
* Enforces `pytest.raises()` to contain simple statements, using `noqa`
to skip this on some cases for now.
* Fixes incorrect exception type (valueerror instead of typeerror) for
iotdimmer.
* Adds check valid types for `iotbulb.set_hsv` and `color` smart module.
* Consolidate exception messages for common interface modules.
2024-08-30 17:30:07 +02:00
Teemu R.
3e43781bb2 Add flake8-logging (LOG) and flake8-logging-format (G) for ruff (#1104)
Enables rules LOG (flake8-logging) and G (flake8-logging-format) for
ruff. This will catch eager log message formatting, among other similar
issues.
2024-08-30 16:13:14 +02:00
J. Nick Koston
b6339be9ec Fix logging in iotdevice when a module is module not supported (#1100)
Debug logger was generating the `repr()` of each module and throwing it away because it had a `%` instead of a `,`
2024-08-23 10:56:33 +01:00
J. Nick Koston
4669e08605 Improve performance of dict merge code (#1097)
Co-authored-by: Teemu R. <tpr@iki.fi>
2024-08-14 16:33:54 -05:00