8000 TP-Link Tapo S505D cannot disable gradual on/off · Issue #1309 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

TP-Link Tapo S505D cannot disable gradual on/off #1309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Avenred opened this issue Nov 25, 2024 · 5 comments · Fixed by #1313
Closed

TP-Link Tapo S505D cannot disable gradual on/off #1309

Avenred opened this issue Nov 25, 2024 · 5 comments · Fixed by #1313
Labels
bug Something isn't working

Comments

@Avenred
Copy link
Avenred commented Nov 25, 2024

Coming from home-assistant/core#131493, it seems like you can't disable the gradual on/off by simply setting the value to 0.

2024-11-24 14:28:25.752 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547238052624] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/tplink/entity.py", line 101, in _async_wrap
    await func(self, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tplink/number.py", line 106, in async_set_native_value
    await self._feature.set_value(int(value))
  File "/usr/local/lib/python3.12/site-packages/kasa/feature.py", line 265, in set_value
    return await getattr(container, self.attribute_setter)(value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/smart/smartmodule.py", line 35, in _async_wrap
    await func(self, *args, **kwargs)
  File "/usr/local/lib/python3.12/site-packages/kasa/smart/modules/lighttransition.py", line 185, in set_turn_on_transition
    return await self.call(
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/smart/smartmodule.py", line 150, in call
    return await self._device._query_helper(method, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/smart/smartdevice.py", line 592, in _query_helper
    res = await self.protocol.query({method: params})
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 89, in query
    return await self._query(request, retry_count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 150, in _query
    raise ex
  File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 94, in _query
    return await self._execute_query(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 281, in _execute_query
    self._handle_response_error_code(response_data, smart_method)
  File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 354, in _handle_response_error_code
    raise DeviceError(msg, error_code=error_code)
kasa.exceptions.DeviceError: Error querying device: 192.168.0.244: PARAMS_ERROR(-1008) for method: set_on_off_gradually_info (error_code=PARAMS_ERROR)
@rytilahti
Copy link
Member

This error comes directly from the device, so for some reason it is not accepting the command. Relevant parts from the log:

DEBUG:kasa.smartprotocol:192.168.0.244 >> '{"method":"set_on_off_gradually_info","request_time_milis":1732501469424,"terminal_uuid":"lWWhnCXRAOtIlM8BsoygVQ==","params":{"on_state":{"enable":false}}}'
<snip>
DEBUG:kasa.smartprotocol:192.168.0.244 << {'error_code': -1008}

Perhaps this device/firmware requires the full payload, so what you could do is to try to execute the following to see if that works and changes the state:

kasa --host 192.168.0.244 -d command set_on_off_gradually_info '{"on_state":{"enable":False, "duration": 1, "max_duration": 60}}'

and then query using:

kasa --host 192.168.0.244 command get_on_off_gradually_info

P.S. Could you run python -m devtools.dump_devinfo --host 192.168.0.244 and create a PR to add the fixture file to our collection? See https://python-kasa.readthedocs.io/en/stable/contribute.html#contributing-fixture-files for details.

@rytilahti rytilahti added the bug Something isn't working label Nov 25, 2024
@Avenred
Copy link
Author
Avenred commented Nov 25, 2024

I couldn't get the first command kasa --host 192.168.0.244 --username user@example.com --password Password123 -d command set_on_off_gradually_info '{"on_state":{"enable":False, "duration": 1, "max_duration": 60}}' to run:

Discovering device 192.168.0.244 for 10 seconds
DEBUG:kasa.discover:[DISCOVERY] 192.168.0.244 >> {'system': {'get_sysinfo': {}}}
DEBUG:kasa.discover:Waiting a total of 10 seconds for responses...
DEBUG:kasa.klaptransport:Created KLAP transport for 192.168.0.244
DEBUG:kasa.discover:[DISCOVERY] 192.168.0.244 << {'error_code': 0,
 'result': {'device_id': 'REDACTED_b9fa5e21747e45b96757187',
            'device_model': 'S505D(US)',
            'device_type': 'SMART.TAPOSWITCH',
            'factory_default': False,
            'ip': '192.168.0.244',
            'is_support_iot_cloud': True,
            'mac': 'D8-44-89-00-00-00',
            'mgt_encrypt_schm': {'encrypt_type': 'KLAP',
                                 'http_port': 80,
                                 'is_support_https': False,
                                 'lv': 2},
            'obd_src': 'matter',
            'owner': 'REDACTED_074EF104C579297942391C9',
            'protocol_version': 1}}
DEBUG:kasa.device:Initializing 192.168.0.244 of type <class 'kasa.smart.smartdevice.SmartDevice'>
Raised error: malformed node or string on line 1: <ast.Name object at 0x0000019AB9217FA0>
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\Downloads\kasa test\venv\Scripts\kasa.exe\__main__.py", line 7, in <module>
    sys.exit(cli())
  File "D:\Downloads\kasa test\venv\lib\site-packages\asyncclick\core.py", line 1205, in __call__
    return anyio.run(self._main, main, args, kwargs, **opts)
  File "D:\Downloads\kasa test\venv\lib\site-packages\anyio\_core\_eventloop.py", line 74, in run
    return async_backend.run(func, args, {}, backend_options)
  File "D:\Downloads\kasa test\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 2284, in run
    return runner.run(wrapper())
  File "D:\Downloads\kasa test\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 210, in run
    return self._loop.run_until_complete(task)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "D:\Downloads\kasa test\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 2272, in wrapper
    return await func(*args)
  File "D:\Downloads\kasa test\venv\lib\site-packages\asyncclick\core.py", line 1208, in _main
    return await main(*args, **kwargs)
  File "D:\Downloads\kasa test\venv\lib\site-packages\asyncclick\core.py", line 1120, in main
    rv = await self.invoke(ctx)
  File "D:\Downloads\kasa test\venv\lib\site-packages\kasa\cli\common.py", line 231, in invoke
    _handle_exception(self._debug, exc)
  File "D:\Downloads\kasa test\venv\lib\site-packages\kasa\cli\common.py", line 229, in invoke
    return await super().invoke(ctx)
  File "D:\Downloads\kasa test\venv\lib\site-packages\asyncclick\core.py", line 1739, in invoke
    return await _process_result(await sub_ctx.command.invoke(sub_ctx))
  File "D:\Downloads\kasa test\venv\lib\site-packages\asyncclick\core.py", line 1485, in invoke
    return await ctx.invoke(self.callback, **ctx.params)
  File "D:\Downloads\kasa test\venv\lib\site-packages\asyncclick\core.py", line 824, in invoke
    rv = await rv
  File "D:\Downloads\kasa test\venv\lib\site-packages\kasa\cli\common.py", line 129, in wrapper
    return await ctx.invoke(wrapped_function, dev, *args, **kwargs)
  File "D:\Downloads\kasa test\venv\lib\site-packages\asyncclick\core.py", line 824, in invoke
    rv = await rv
  File "D:\Downloads\kasa test\venv\lib\site-packages\kasa\cli\main.py", line 437, in cmd_command
    parameters = ast.literal_eval(parameters)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ast.py", line 110, in literal_eval
    return _convert(node_or_string)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ast.py", line 99, in _convert
    return dict(zip(map(_convert, node.keys),
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ast.py", line 109, in _convert
    return _convert_signed_num(node)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ast.py", line 83, in _convert_signed_num
    return _convert_num(node)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ast.py", line 74, in _convert_num
    _raise_malformed_node(node)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ast.py", line 71, in _raise_malformed_node
    raise ValueError(msg + f': {node!r}')
ValueError: malformed node or string on line 1: <ast.Name object at 0x0000019AB9217FA0>

@rytilahti
Copy link
Member
rytilahti commented Nov 25, 2024

Ohh, that sounds like an issue on how Windows handles the parameters. I don't have a Windows machine to test right now, but you could try to escape the " characters using \" in the JSON payload to see if that helps. Alternatively, if you are using cmd, you could try if it works in powershell.

@Avenred
Copy link
Author
Avenred commented Nov 25, 2024

Escaping the double quotes with a backslash seems to have worked. It looks like the initial assumption that it requires a duration in the payload is correct, as sending it {"on_state":{"enable":False, "duration": 1, "max_duration": 60}} disabled the fade on time.

This is just a guess, but the app will show you whatever value you have set for "duration" when you enable the fade on/fade off time. Even if you send it a payload that has "enable" set to false, it'll still show you the "duration" value you set in the app as soon as you enable the fade on/fade off time. That's probably why the light switch requires that you give it a duration when turning it off -- so it can remember what value to give the app once you turn it back on.

Here's the debug output for disabling the fade on time but with a duration of 5. When this was sent, the light had no fade on time at all:

Discovering device 192.168.0.244 for 10 seconds
DEBUG:kasa.discover:[DISCOVERY] 192.168.0.244 >> {'system': {'get_sysinfo': {}}}
DEBUG:kasa.discover:Waiting a total of 10 seconds for responses...
DEBUG:kasa.klaptransport:Created KLAP transport for 192.168.0.244
DEBUG:kasa.discover:[DISCOVERY] 192.168.0.244 << {'error_code': 0,
 'result': {'device_id': 'REDACTED_b9fa5e21747e45b96757187',
            'device_model': 'S505D(US)',
            'device_type': 'SMART.TAPOSWITCH',
            'factory_default': False,
            'ip': '192.168.0.244',
            'is_support_iot_cloud': True,
            'mac': 'D8-44-89-00-00-00',
            'mgt_encrypt_schm': {'encrypt_type': 'KLAP',
                                 'http_port': 80,
                                 'is_support_https': False,
                                 'lv': 2},
            'obd_src': 'matter',
            'owner': 'REDACTED_074EF104C579297942391C9',
            'protocol_version': 1}}
DEBUG:kasa.device:Initializing 192.168.0.244 of type <class 'kasa.smart.smartdevice.SmartDevice'>
DEBUG:kasa.smartprotocol:192.168.0.244 >> '{"method":"set_on_off_gradually_info","request_time_milis":1732576035658,"terminal_uuid":"AAA/og==","params":{"on_state":{"enable":false,"duration":5,"max_duration":60}}}'
DEBUG:kasa.klaptransport:Starting handshake with 192.168.0.244
DEBUG:kasa.httpclient:Posting to http://192.168.0.244/app/handshake1
DEBUG:kasa.klaptransport:Handshake1 posted at 2024-11-25 16:07:15.677687. Host is 192.168.0.244, Response status is 200, Request was 260592278e48cfae77de348487c4542e
DEBUG:kasa.klaptransport:Handshake1 success at 2024-11-25 16:07:15.677687. Host is 192.168.0.244, Server remote_seed is: 62dd5829c2fdd82be22dda2b323dda2a, server hash is: 980ae57178325e7bb21de882b318fb6d8a749064e795faa0bad17dc7af614127
DEBUG:kasa.klaptransport:handshake1 hashes match with expected credentials
DEBUG:kasa.httpclient:Posting to http://192.168.0.244/app/handshake2
DEBUG:kasa.klaptransport:Handshake2 posted 2024-11-25 16:07:15.696369. Host is 192.168.0.244, Response status is 200, Request was 2b9bc7da2295ac58d9fce29ece113f3499c9de65c63f223ee2767c8827712bd9
DEBUG:kasa.klaptransport:Handshake with 192.168.0.244 complete
DEBUG:kasa.httpclient:Posting to http://192.168.0.244/app/request
DEBUG:kasa.klaptransport:Device 192.168.0.244 query posted Host is 192.168.0.244, Sequence is -1765251009, Response status is 200, Request was {"method":"set_on_off_gradually_info","request_time_milis":1732576035658,"terminal_uuid":"AAANgDyQ0/og==","params":{"on_state":{"enable":false,"duration":5,"max_duration":60}}}
DEBUG:kasa.klaptransport:Device 192.168.0.244 query response received
DEBUG:kasa.smartprotocol:192.168.0.244 << {'error_code': 0}
{"set_on_off_gradually_info": null}

Here is the output when I send get_on_off_gradually_info:

Discovering device 192.168.0.244 for 10 seconds
DEBUG:kasa.discover:[DISCOVERY] 192.168.0.244 >> {'system': {'get_sysinfo': {}}}
DEBUG:kasa.discover:Waiting a total of 10 seconds for responses...
DEBUG:kasa.klaptransport:Created KLAP transport for 192.168.0.244
DEBUG:kasa.discover:[DISCOVERY] 192.168.0.244 << {'error_code': 0,
 'result': {'device_id': 'REDACTED_b9fa5e21747e45b96757187',
            'device_model': 'S505D(US)',
            'device_type': 'SMART.TAPOSWITCH',
            'factory_default': False,
            'ip': '192.168.0.244',
            'is_support_iot_cloud': True,
            'mac': 'D8-44-89-00-00-00',
            'mgt_encrypt_schm': {'encrypt_type': 'KLAP',
                                 'http_port': 80,
                                 'is_support_https': False,
                                 'lv': 2},
            'obd_src': 'matter',
            'owner': 'REDACTED_074EF104C579297942391C9',
            'protocol_version': 1}}
DEBUG:kasa.device:Initializing 192.168.0.244 of type <class 'kasa.smart.smartdevice.SmartDevice'>
DEBUG:kasa.smartprotocol:192.168.0.244 >> '{"method":"get_on_off_gradually_info","request_time_milis":1732576265878,"terminal_uuid":"AAAbHbKPljsydng=="}'
DEBUG:kasa.klaptransport:Starting handshake with 192.168.0.244
DEBUG:kasa.httpclient:Posting to http://192.168.0.244/app/handshake1
DEBUG:kasa.klaptransport:Handshake1 posted at 2024-11-25 16:11:05.926833. Host is 192.168.0.244, Response status is 200, Request was 5ce9941a829bceda593309596ebe95ab
DEBUG:kasa.klaptransport:Handshake1 success at 2024-11-25 16:11:05.926833. Host is 192.168.0.244, Server remote_seed is: b2d4ba6534143965f4d7b9643737b864, server hash is: a4d1098c4bff2471b8c217aa05b8e509dc81f75ac1879dd69458822c59235d22
DEBUG:kasa.klaptransport:handshake1 hashes match with expected credentials
DEBUG:kasa.httpclient:Posting to http://192.168.0.244/app/handshake2
DEBUG:kasa.klaptransport:Handshake2 posted 2024-11-25 16:11:05.963203. Host is 192.168.0.244, Response status is 200, Request was 5bee1b67d6ee72a21b9afc716c7658dc5897f5c7ce39e0a74d23987d916a66d5
DEBUG:kasa.klaptransport:Handshake with 192.168.0.244 complete
DEBUG:kasa.httpclient:Posting to http://192.168.0.244/app/request
DEBUG:kasa.klaptransport:Device 192.168.0.244 query posted Host is 192.168.0.244, Sequence is -1723604828, Response status is 200, Request was {"method":"get_on_off_gradually_info","request_time_milis":1732576265878,"terminal_uuid":"AAAYbHbKPljsydng=="}
DEBUG:kasa.klaptransport:Device 192.168.0.244 query response received
DEBUG:kasa.smartprotocol:192.168.0.244 << {'error_code': 0,
 'result': {'off_state': {'duration': 1, 'enable': False, 'max_duration': 60},
            'on_state': {'duration': 5, 'enable': False, 'max_duration': 60}}}
{"get_on_off_gradually_info": {"on_state": {"duration": 5, "enable": false, "max_duration": 60}, "off_state": {"duration": 1, "enable": false, "max_duration": 60}}}

@rytilahti
Copy link
Member

Great 👍 Yeah, so there may be differences in how different devices/firmware versions handle command parameters, and your device just happens to handle it differently than all of the other devices which will accept "updates" containing only values that you want to change.

I created #1313 to fix it, but we should test this on more devices to avoid breaking any existing setups. I have only tested this on L530 where it works fine.

@rytilahti rytilahti modified the milestone: 0.8.0 Nov 25, 2024
@sdb9696 sdb9696 mentioned this issue Nov 26, 2024
sdb9696 added a commit that referenced this issue Nov 26, 2024
## [0.8.0](https://github.com/python-kasa/python-kasa/tree/0.8.0) (2024-11-26)

[Full Changelog](0.7.7...0.8.0)

**Release highlights:**

- **Initial support for devices using the Tapo camera protocol, i.e. Tapo cameras and the Tapo H200 hub.**
- New camera functionality such as exposing RTSP streaming urls and camera pan/tilt.
- New way of testing module support for individual features with `has_feature` and `get_feature`.
- Adding voltage and current monitoring to `smart` devices.
- Migration from pydantic to mashumaro for serialization.

Special thanks to @ryenitcher and @Puxtril for their new contributions to the improvement of the project! Also thanks to everyone who has helped with testing, contributing fixtures, and reporting issues!

**Breaking change notes:**

- Removed support for python <3.11. If you haven't got a compatible version try [uv](https://docs.astral.sh/uv/).
- Renamed `device_config.to_dict()` to `device_config.to_dict_control_credentials()`. `to_dict()` is still available but takes no parameters.
- From the `iot.Cloud` module the `iot.CloudInfo` class attributes have been converted to snake case.


**Breaking changes:**

- Migrate iot cloud module to mashumaro [\#1282](#1282) (@sdb9696)
- Replace custom deviceconfig serialization with mashumaru [\#1274](#1274) (@sdb9696)
- Remove support for python \<3.11 [\#1273](#1273) (@sdb9696)

**Implemented enhancements:**

- Update cli modify presets to support smart devices [\#1295](#1295) (@sdb9696)
- Use credentials\_hash for smartcamera rtsp url [\#1293](#1293) (@sdb9696)
- Add voltage and current monitoring to smart Devices [\#1281](#1281) (@ryenitcher)
- Update cli feature command for actions not to require a value [\#1264](#1264) (@sdb9696)
- Add pan tilt camera module [\#1261](#1261) (@sdb9696)
- Add alarm module for smartcamera hubs [\#1258](#1258) (@sdb9696)
- Move TAPO smartcamera out of experimental package [\#1255](#1255) (@sdb9696)
- Add SmartCamera Led Module [\#1249](#1249) (@sdb9696)
- Use component queries to select smartcamera modules [\#1248](#1248) (@sdb9696)
- Print formatting for IotLightPreset [\#1216](#1216) (@Puxtril)
- Allow getting Annotated features from modules [\#1018](#1018) (@sdb9696)
- Add common Thermostat module [\#977](#977) (@sdb9696)

**Fixed bugs:**

- TP-Link Tapo S505D cannot disable gradual on/off  [\#1309](#1309)
- Inconsistent emeter information between features and emeter cli [\#1308](#1308)
- How to dump power usage after latest updates? [\#1306](#1306)
- kasa.discover: Got unsupported connection type: 'device\_family': 'SMART.IPCAMERA' [\#1267](#1267)
- device \_\_repr\_\_ fails if no sys\_info [\#1262](#1262)
- Tapo P110M: Error processing Energy for device, module will be unavailable: get\_energy\_usage for Energy  [\#1243](#1243)
- Listing light presets throws error [\#1201](#1201)
- Include duration when disabling smooth transition on/off [\#1313](#1313) (@rytilahti)
- Expose energy command to cli [\#1307](#1307) (@rytilahti)
- Make discovery on unsupported devices less noisy [\#1291](#1291) (@rytilahti)
- Fix repr for device created with no sysinfo or discovery info" [\#1266](#1266) (@sdb9696)
- Fix discovery by alias for smart devices [\#1260](#1260) (@sdb9696)
- Make \_\_repr\_\_ work on discovery info [\#1233](#1233) (@rytilahti)

**Added support for devices:**

- Add HS200 \(US\) Smart Fixture [\#1303](#1303) (@ZeliardM)
- Add smartcamera devices to supported docs [\#1257](#1257) (@sdb9696)
- Add P110M\(AU\) fixture [\#1244](#1244) (@rytilahti)
- Add L630 fixture [\#1240](#1240) (@rytilahti)
- Add EP40M Fixture [\#1238](#1238) (@ryenitcher)
- Add KS220 Fixture [\#1237](#1237) (@ryenitcher)

**Documentation updates:**

- Use markdown footnotes in supported.md [\#1310](#1310) (@sdb9696)
- Update docs for the new module attributes has/get feature [\#1301](#1301) (@sdb9696)
- Fixup contributing.md for running test against a real device [\#1236](#1236) (@sdb9696)

**Project maintenance:**

- Rename tests/smartcamera to tests/smartcam [\#1315](#1315) (@sdb9696)
- Do not error on smartcam hub attached smartcam child devices [\#1314](#1314) (@sdb9696)
- Add P110M\(EU\) fixture [\#1305](#1305) (@sdb9696)
- Run tests with caplog in a single worker [\#1304](#1304) (@sdb9696)
- Rename smartcamera to smartcam [\#1300](#1300) (@sdb9696)
- Move iot fixtures into iot subfolder [\#1299](#1299) (@sdb9696)
- Annotate fan\_speed\_level of Fan interface [\#1298](#1298) (@sdb9696)
- Add PIR ADC Values to Test Fixtures [\#1296](#1296) (@ryenitcher)
- Exclude \_\_getattr\_\_ for deprecated attributes from type checkers [\#1294](#1294) (@sdb9696)
- Simplify omit http\_client in DeviceConfig serialization [\#1292](#1292) (@sdb9696)
- Add SMART Voltage Monitoring to Fixtures [\#1290](#1290) (@ryenitcher)
- Remove pydantic dependency [\#1289](#1289) (@sdb9696)
- Do not print out all the fixture names at the start of test runs [\#1287](#1287) (@sdb9696)
- dump\_devinfo: iot light strip commands [\#1286](#1286) (@sdb9696)
- Migrate TurnOnBehaviours to mashumaro [\#1285](#1285) (@sdb9696)
- dump\_devinfo: query smartlife.iot.common.cloud for fw updates [\#1284](#1284) (@rytilahti)
- Migrate RuleModule to mashumaro [\#1283](#1283) (@sdb9696)
- Update sphinx dependency to 6.2 to fix docs build [\#1280](#1280) (@sdb9696)
- Update DiscoveryResult to use mashu Annotated Alias [\#1279](#1279) (@sdb9696)
- Extend dump\_devinfo iot queries [\#1278](#1278) (@sdb9696)
- Migrate triggerlogs to mashumaru [\#1277](#1277) (@sdb9696)
- Migrate smart firmware module to mashumaro [\#1276](#1276) (@sdb9696)
- Migrate IotLightPreset to mashumaru [\#1275](#1275) (@sdb9696)
- Allow callable coroutines for feature setters [\#1272](#1272) (@sdb9696)
- Fix deprecated SSLContext\(\) usage [\#1271](#1271) (@sdb9696)
- Use \_get\_device\_info methods for smart and iot devs in devtools [\#1265](#1265) (@sdb9696)
- Remove experimental support [\#1256](#1256) (@sdb9696)
- Move protocol modules into protocols package [\#1254](#1254) (@sdb9696)
- Add linkcheck to readthedocs CI [\#1253](#1253) (@rytilahti)
- Update cli energy command to use energy module [\#1252](#1252) (@sdb9696)
- Consolidate warnings for fixtures missing child devices [\#1251](#1251) (@sdb9696)
- Update smartcamera fixtures with components [\#1250](#1250) (@sdb9696)
- Move transports into their own package [\#1247](#1247) (@rytilahti)
- Fix warnings in our test suite [\#1246](#1246) (@rytilahti)
- Move tests folder to top level of project [\#1242](#1242) (@sdb9696)
- Fix test framework running against real devices [\#1235](#1235) (@sdb9696)
- Add Additional Firmware Test Fixures [\#1234](#1234) (@ryenitcher)
- Update DiscoveryResult to use Mashumaro instead of pydantic [\#1231](#1231) (@sdb9696)
- Update fixture for ES20M 1.0.11 [\#1215](#1215) (@rytilahti)
- Enable ruff check for ANN [\#1139](#1139) (@rytilahti)

**Closed issues:**

- Expose Fan speed range from the library [\#1008](#1008)
- \[META\] 0.7 series - module support for SMART devices, support for introspectable device features and refactoring the library [\#783](#783)
rytilahti pushed a commit that referenced this issue Nov 29, 2024
## [0.8.0](https://github.com/python-kasa/python-kasa/tree/0.8.0) (2024-11-26)

[Full Changelog](0.7.7...0.8.0)

**Release highlights:**

- **Initial support for devices using the Tapo camera protocol, i.e. Tapo cameras and the Tapo H200 hub.**
- New camera functionality such as exposing RTSP streaming urls and camera pan/tilt.
- New way of testing module support for individual features with `has_feature` and `get_feature`.
- Adding voltage and current monitoring to `smart` devices.
- Migration from pydantic to mashumaro for serialization.

Special thanks to @ryenitcher and @Puxtril for their new contributions to the improvement of the project! Also thanks to everyone who has helped with testing, contributing fixtures, and reporting issues!

**Breaking change notes:**

- Removed support for python <3.11. If you haven't got a compatible version try [uv](https://docs.astral.sh/uv/).
- Renamed `device_config.to_dict()` to `device_config.to_dict_control_credentials()`. `to_dict()` is still available but takes no parameters.
- From the `iot.Cloud` module the `iot.CloudInfo` class attributes have been converted to snake case.


**Breaking changes:**

- Migrate iot cloud module to mashumaro [\#1282](#1282) (@sdb9696)
- Replace custom deviceconfig serialization with mashumaru [\#1274](#1274) (@sdb9696)
- Remove support for python \<3.11 [\#1273](#1273) (@sdb9696)

**Implemented enhancements:**

- Update cli modify presets to support smart devices [\#1295](#1295) (@sdb9696)
- Use credentials\_hash for smartcamera rtsp url [\#1293](#1293) (@sdb9696)
- Add voltage and current monitoring to smart Devices [\#1281](#1281) (@ryenitcher)
- Update cli feature command for actions not to require a value [\#1264](#1264) (@sdb9696)
- Add pan tilt camera module [\#1261](#1261) (@sdb9696)
- Add alarm module for smartcamera hubs [\#1258](#1258) (@sdb9696)
- Move TAPO smartcamera out of experimental package [\#1255](#1255) (@sdb9696)
- Add SmartCamera Led Module [\#1249](#1249) (@sdb9696)
- Use component queries to select smartcamera modules [\#1248](#1248) (@sdb9696)
- Print formatting for IotLightPreset [\#1216](#1216) (@Puxtril)
- Allow getting Annotated features from modules [\#1018](#1018) (@sdb9696)
- Add common Thermostat module [\#977](#977) (@sdb9696)

**Fixed bugs:**

- TP-Link Tapo S505D cannot disable gradual on/off  [\#1309](#1309)
- Inconsistent emeter information between features and emeter cli [\#1308](#1308)
- How to dump power usage after latest updates? [\#1306](#1306)
- kasa.discover: Got unsupported connection type: 'device\_family': 'SMART.IPCAMERA' [\#1267](#1267)
- device \_\_repr\_\_ fails if no sys\_info [\#1262](#1262)
- Tapo P110M: Error processing Energy for device, module will be unavailable: get\_energy\_usage for Energy  [\#1243](#1243)
- Listing light presets throws error [\#1201](#1201)
- Include duration when disabling smooth transition on/off [\#1313](#1313) (@rytilahti)
- Expose energy command to cli [\#1307](#1307) (@rytilahti)
- Make discovery on unsupported devices less noisy [\#1291](#1291) (@rytilahti)
- Fix repr for device created with no sysinfo or discovery info" [\#1266](#1266) (@sdb9696)
- Fix discovery by alias for smart devices [\#1260](#1260) (@sdb9696)
- Make \_\_repr\_\_ work on discovery info [\#1233](#1233) (@rytilahti)

**Added support for devices:**

- Add HS200 \(US\) Smart Fixture [\#1303](#1303) (@ZeliardM)
- Add smartcamera devices to supported docs [\#1257](#1257) (@sdb9696)
- Add P110M\(AU\) fixture [\#1244](#1244) (@rytilahti)
- Add L630 fixture [\#1240](#1240) (@rytilahti)
- Add EP40M Fixture [\#1238](#1238) (@ryenitcher)
- Add KS220 Fixture [\#1237](#1237) (@ryenitcher)

**Documentation updates:**

- Use markdown footnotes in supported.md [\#1310](#1310) (@sdb9696)
- Update docs for the new module attributes has/get feature [\#1301](#1301) (@sdb9696)
- Fixup contributing.md for running test against a real device [\#1236](#1236) (@sdb9696)

**Project maintenance:**

- Rename tests/smartcamera to tests/smartcam [\#1315](#1315) (@sdb9696)
- Do not error on smartcam hub attached smartcam child devices [\#1314](#1314) (@sdb9696)
- Add P110M\(EU\) fixture [\#1305](#1305) (@sdb9696)
- Run tests with caplog in a single worker [\#1304](#1304) (@sdb9696)
- Rename smartcamera to smartcam [\#1300](#1300) (@sdb9696)
- Move iot fixtures into iot subfolder [\#1299](#1299) (@sdb9696)
- Annotate fan\_speed\_level of Fan interface [\#1298](#1298) (@sdb9696)
- Add PIR ADC Values to Test Fixtures [\#1296](#1296) (@ryenitcher)
- Exclude \_\_getattr\_\_ for deprecated attributes from type checkers [\#1294](#1294) (@sdb9696)
- Simplify omit http\_client in DeviceConfig serialization [\#1292](#1292) (@sdb9696)
- Add SMART Voltage Monitoring to Fixtures [\#1290](#1290) (@ryenitcher)
- Remove pydantic dependency [\#1289](#1289) (@sdb9696)
- Do not print out all the fixture names at the start of test runs [\#1287](#1287) (@sdb9696)
- dump\_devinfo: iot light strip commands [\#1286](#1286) (@sdb9696)
- Migrate TurnOnBehaviours to mashumaro [\#1285](#1285) (@sdb9696)
- dump\_devinfo: query smartlife.iot.common.cloud for fw updates [\#1284](#1284) (@rytilahti)
- Migrate RuleModule to mashumaro [\#1283](#1283) (@sdb9696)
- Update sphinx dependency to 6.2 to fix docs build [\#1280](#1280) (@sdb9696)
- Update DiscoveryResult to use mashu Annotated Alias [\#1279](#1279) (@sdb9696)
- Extend dump\_devinfo iot queries [\#1278](#1278) (@sdb9696)
- Migrate triggerlogs to mashumaru [\#1277](#1277) (@sdb9696)
- Migrate smart firmware module to mashumaro [\#1276](#1276) (@sdb9696)
- Migrate IotLightPreset to mashumaru [\#1275](#1275) (@sdb9696)
- Allow callable coroutines for feature setters [\#1272](#1272) (@sdb9696)
- Fix deprecated SSLContext\(\) usage [\#1271](#1271) (@sdb9696)
- Use \_get\_device\_info methods for smart and iot devs in devtools [\#1265](#1265) (@sdb9696)
- Remove experimental support [\#1256](#1256) (@sdb9696)
- Move protocol modules into protocols package [\#1254](#1254) (@sdb9696)
- Add linkcheck to readthedocs CI [\#1253](#1253) (@rytilahti)
- Update cli energy command to use energy module [\#1252](#1252) (@sdb9696)
- Consolidate warnings for fixtures missing child devices [\#1251](#1251) (@sdb9696)
- Update smartcamera fixtures with components [\#1250](#1250) (@sdb9696)
- Move transports into their own package [\#1247](#1247) (@rytilahti)
- Fix warnings in our test suite [\#1246](#1246) (@rytilahti)
- Move tests folder to top level of project [\#1242](#1242) (@sdb9696)
- Fix test framework running against real devices [\#1235](#1235) (@sdb9696)
- Add Additional Firmware Test Fixures [\#1234](#1234) (@ryenitcher)
- Update DiscoveryResult to use Mashumaro instead of pydantic [\#1231](#1231) (@sdb9696)
- Update fixture for ES20M 1.0.11 [\#1215](#1215) (@rytilahti)
- Enable ruff check for ANN [\#1139](#1139) (@rytilahti)

**Closed issues:**

- Expose Fan speed range from the library [\#1008](#1008)
- \[META\] 0.7 series - module support for SMART devices, support for introspectable device features and refactoring the library [\#783](#783)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0