Commit Graph

5 Commits

Author SHA1 Message Date
Steven B
7888f4904a
Fix light preset module when list contains lighting effects (#1048)
Fixes the residual issues with the light preset module not handling
unexpected `lighting_effect` items in the presets list.

Completes the fixes started with PR
https://github.com/python-kasa/python-kasa/pull/1043 to fix
https://github.com/python-kasa/python-kasa/issues/1040, [HA
#121115](https://github.com/home-assistant/core/issues/121115) and [HA
#121119](https://github.com/home-assistant/core/issues/121119)

With this PR affected devices will no longer have the light preset
functionality disabled. As this is a new feature this does not warrant a
hotfix so will go into the next release.

Updated fixture for testing thanks to @szssamuel, many thanks!
2024-07-04 17:22:47 +02:00
Steven B
905a14895d
Handle module errors more robustly and add query params to light preset and transition (#1036)
Ensures that all modules try to access their data in `_post_update_hook` in a safe manner and disable themselves if there's an error.
Also adds parameters to get_preset_rules and get_on_off_gradually_info to fix issues with recent firmware updates.
[#1033](https://github.com/python-kasa/python-kasa/issues/1033)
2024-07-04 08:02:50 +01:00
Teemu R
472008e818
Drop python3.8 support (#992)
Drop support for soon-to-be eol'd python 3.8.
This will allow some minor cleanups & makes it easier to add support for
timezones.

Related to
https://github.com/python-kasa/python-kasa/issues/980#issuecomment-2170889543
2024-06-19 20:24:12 +02:00
Steven B
927fe648ac
Better checking of child modules not supported by parent device (#966)
Replaces the logic to skip adding child modules to parent devices based
on whether a device is a wall switch and instead relies on the
`_check_supported` method. Is more future proof and will fix issue with
the P300 with child `auto_off` modules
https://github.com/python-kasa/python-kasa/pull/915 not supported on the
parent.
2024-06-10 15:13:46 +02:00
Steven B
273c541fcc
Add light presets common module to devices. (#907)
Adds light preset common module for switching to presets and saving presets.
Deprecates the `presets` attribute and `save_preset` method from the `bulb` 
interface in favour of the modular approach.  Allows setting preset for `iot` 
which was not previously supported.
2024-05-19 11:20:18 +01:00