python-kasa 0.7.1__tar.gz → 0.7.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_kasa-0.7.3/.gitignore +30 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/CHANGELOG.md +59 -6
- {python_kasa-0.7.1 → python_kasa-0.7.3}/PKG-INFO +30 -26
- {python_kasa-0.7.1 → python_kasa-0.7.3}/README.md +3 -2
- python_kasa-0.7.3/devtools/README.md +128 -0
- python_kasa-0.7.3/devtools/__init__.py +1 -0
- python_kasa-0.7.3/devtools/bench/benchmark.py +31 -0
- python_kasa-0.7.3/devtools/bench/utils/__init__.py +1 -0
- python_kasa-0.7.3/devtools/bench/utils/data.py +140 -0
- python_kasa-0.7.3/devtools/bench/utils/original.py +48 -0
- python_kasa-0.7.3/devtools/create_module_fixtures.py +63 -0
- python_kasa-0.7.3/devtools/dump_devinfo.py +696 -0
- python_kasa-0.7.3/devtools/generate_supported.py +261 -0
- python_kasa-0.7.3/devtools/helpers/__init__.py +1 -0
- python_kasa-0.7.3/devtools/helpers/smartrequests.py +420 -0
- python_kasa-0.7.3/devtools/parse_pcap.py +101 -0
- python_kasa-0.7.3/devtools/parse_pcap_klap.py +350 -0
- python_kasa-0.7.3/devtools/perftest.py +94 -0
- python_kasa-0.7.3/docs/Makefile +20 -0
- python_kasa-0.7.3/docs/make.bat +35 -0
- python_kasa-0.7.3/docs/source/SUPPORTED.md +3 -0
- python_kasa-0.7.3/docs/source/_static/copybutton.js +65 -0
- python_kasa-0.7.3/docs/source/cli.rst +77 -0
- python_kasa-0.7.3/docs/source/codeinfo.md +26 -0
- python_kasa-0.7.3/docs/source/conf.py +71 -0
- python_kasa-0.7.3/docs/source/contribute.md +86 -0
- python_kasa-0.7.3/docs/source/deprecated.md +67 -0
- python_kasa-0.7.3/docs/source/guides/connect.md +10 -0
- python_kasa-0.7.3/docs/source/guides/device.md +10 -0
- python_kasa-0.7.3/docs/source/guides/discover.md +11 -0
- python_kasa-0.7.3/docs/source/guides/energy.md +27 -0
- python_kasa-0.7.3/docs/source/guides/feature.md +10 -0
- python_kasa-0.7.3/docs/source/guides/light.md +26 -0
- python_kasa-0.7.3/docs/source/guides/module.md +10 -0
- python_kasa-0.7.3/docs/source/guides/strip.md +10 -0
- python_kasa-0.7.3/docs/source/guides.md +16 -0
- python_kasa-0.7.3/docs/source/index.md +12 -0
- python_kasa-0.7.3/docs/source/library.md +15 -0
- python_kasa-0.7.3/docs/source/reference.md +173 -0
- python_kasa-0.7.3/docs/source/smartbulb.rst +79 -0
- python_kasa-0.7.3/docs/source/smartdevice.rst +105 -0
- python_kasa-0.7.3/docs/source/smartdimmer.rst +18 -0
- python_kasa-0.7.3/docs/source/smartlightstrip.rst +17 -0
- python_kasa-0.7.3/docs/source/smartplug.rst +18 -0
- python_kasa-0.7.3/docs/source/smartstrip.rst +36 -0
- python_kasa-0.7.3/docs/source/topics.md +232 -0
- python_kasa-0.7.3/docs/source/tutorial.md +11 -0
- python_kasa-0.7.3/docs/tutorial.py +95 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/aestransport.py +12 -4
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/device_factory.py +5 -2
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/deviceconfig.py +11 -2
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/discover.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/emeterstatus.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/feature.py +3 -2
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/iotbulb.py +9 -3
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/iotdevice.py +3 -14
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/iotdimmer.py +8 -8
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/iotmodule.py +9 -8
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/klaptransport.py +14 -14
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/alarm.py +7 -5
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/color.py +11 -5
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/firmware.py +51 -24
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/lighteffect.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/smartmodule.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smartprotocol.py +3 -2
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/conftest.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/discovery_fixtures.py +2 -2
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fakeprotocol_iot.py +3 -1
- python_kasa-0.7.3/kasa/tests/fixtures/smart/KH100(EU)_1.0_1.2.3.json +255 -0
- python_kasa-0.7.3/kasa/tests/fixtures/smart/KH100(EU)_1.0_1.5.12.json +429 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/features/test_brightness.py +8 -6
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/features/test_colortemp.py +2 -2
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_autooff.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_contact.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_fan.py +2 -2
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_firmware.py +35 -5
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_humidity.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_light_effect.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_light_strip_effect.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_motionsensor.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_temperature.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_temperaturecontrol.py +16 -7
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_waterleak.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_aestransport.py +28 -4
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_bulb.py +80 -21
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_common_modules.py +12 -14
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_device.py +4 -2
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_dimmer.py +30 -10
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_discovery.py +4 -4
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_emeter.py +2 -2
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_feature.py +4 -4
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_httpclient.py +2 -2
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_iotdevice.py +20 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_klapprotocol.py +14 -14
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_lightstrip.py +3 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_protocol.py +22 -29
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_readme_examples.py +3 -49
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_smartprotocol.py +1 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_usage.py +2 -1
- {python_kasa-0.7.1 → python_kasa-0.7.3}/pyproject.toml +73 -59
- {python_kasa-0.7.1 → python_kasa-0.7.3}/LICENSE +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/__init__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/__init__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/__main__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/common.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/device.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/discover.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/feature.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/lazygroup.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/light.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/main.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/schedule.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/time.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/usage.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/cli/wifi.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/credentials.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/device.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/device_type.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/exceptions.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/httpclient.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/interfaces/__init__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/interfaces/energy.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/interfaces/fan.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/interfaces/led.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/interfaces/light.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/interfaces/lighteffect.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/interfaces/lightpreset.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/__init__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/effects.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/iotlightstrip.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/iotplug.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/iotstrip.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/__init__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/ambientlight.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/antitheft.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/cloud.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/countdown.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/emeter.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/led.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/light.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/lighteffect.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/lightpreset.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/motion.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/rulemodule.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/schedule.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/time.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iot/modules/usage.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/iotprotocol.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/json.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/module.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/modulemapping.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/modulemapping.pyi +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/protocol.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/py.typed +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/__init__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/effects.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/__init__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/autooff.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/batterysensor.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/brightness.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/childdevice.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/cloud.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/colortemperature.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/contactsensor.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/devicemodule.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/energy.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/fan.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/frostprotection.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/humiditysensor.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/led.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/light.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/lightpreset.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/lightstripeffect.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/lighttransition.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/motionsensor.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/reportmode.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/temperaturecontrol.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/temperaturesensor.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/time.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/modules/waterleaksensor.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/smartchilddevice.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/smart/smartdevice.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/__init__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/device_fixtures.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fakeprotocol_smart.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtureinfo.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/EP10(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/EP40(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/ES20M(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS100(UK)_1.0_1.2.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS100(UK)_4.1_1.1.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS100(US)_1.0_1.2.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS100(US)_2.0_1.5.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS103(US)_1.0_1.5.7.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS103(US)_2.1_1.1.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS103(US)_2.1_1.1.4.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS105(US)_1.0_1.5.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS107(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS110(EU)_1.0_1.2.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS110(EU)_4.0_1.0.4.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS110(US)_1.0_1.2.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS200(US)_2.0_1.5.7.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS200(US)_5.0_1.0.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS210(US)_1.0_1.5.8.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS220(US)_1.0_1.5.7.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS220(US)_2.0_1.0.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS300(US)_1.0_1.0.10.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS300(US)_1.0_1.0.21.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS300(US)_2.0_1.0.12.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/HS300(US)_2.0_1.0.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL110(US)_1.0_1.8.11.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL120(US)_1.0_1.8.11.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL120(US)_1.0_1.8.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL125(US)_1.20_1.0.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL125(US)_2.0_1.0.7.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL125(US)_4.0_1.0.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL130(EU)_1.0_1.8.8.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL130(US)_1.0_1.8.11.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL135(US)_1.0_1.0.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL400L5(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL400L5(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL420L5(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL430(UN)_2.0_1.0.8.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL430(US)_1.0_1.0.10.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL430(US)_2.0_1.0.11.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL430(US)_2.0_1.0.8.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL430(US)_2.0_1.0.9.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL50(US)_1.0_1.1.13.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL60(UN)_1.0_1.1.4.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KL60(US)_1.0_1.1.13.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP100(US)_3.0_1.0.1.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP105(UK)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP105(UK)_1.0_1.0.7.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP115(EU)_1.0_1.0.16.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP115(US)_1.0_1.0.17.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP115(US)_1.0_1.0.21.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP125(US)_1.0_1.0.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP200(US)_3.0_1.0.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP303(UK)_1.0_1.0.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP303(US)_2.0_1.0.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP400(US)_1.0_1.0.10.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP400(US)_2.0_1.0.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP400(US)_3.0_1.0.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP400(US)_3.0_1.0.4.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP401(US)_1.0_1.0.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP405(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KP405(US)_1.0_1.0.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KS200M(US)_1.0_1.0.11.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KS200M(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KS220M(US)_1.0_1.0.4.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/KS230(US)_1.0_1.0.14.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/LB110(US)_1.0_1.8.11.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.1.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.2.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.10.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/HS220(US)_3.26_1.0.1.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/KH100(UK)_1.0_1.5.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/KP125M(US)_1.0_1.1.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/KS205(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/KS205(US)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/KS225(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/KS225(US)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/KS240(US)_1.0_1.0.4.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/KS240(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L510B(EU)_3.0_1.0.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L510E(US)_3.0_1.0.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L510E(US)_3.0_1.1.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.0.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.1.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.1.6.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L530E(US)_2.0_1.1.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L900-10(EU)_1.0_1.0.17.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L900-10(US)_1.0_1.0.11.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L900-5(EU)_1.0_1.0.17.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L900-5(EU)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L920-5(EU)_1.0_1.0.7.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L920-5(EU)_1.0_1.1.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L920-5(US)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L920-5(US)_1.0_1.1.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/L930-5(US)_1.0_1.1.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P100_1.0.0_1.1.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P100_1.0.0_1.3.7.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P100_1.0.0_1.4.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P110(EU)_1.0_1.0.7.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P110(EU)_1.0_1.2.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P110(UK)_1.0_1.3.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P115(EU)_1.0_1.2.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P125M(US)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P135(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.13.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.15.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.7.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/S500D(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/S505(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/S505D(US)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/TP15(US)_1.0_1.0.3.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/TP25(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/child/KE100(EU)_1.0_2.4.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/child/KE100(EU)_1.0_2.8.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/child/KE100(UK)_1.0_2.8.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/child/T100(EU)_1.0_1.12.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/child/T110(EU)_1.0_1.8.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/child/T300(EU)_1.0_1.7.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/child/T310(EU)_1.0_1.5.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/fixtures/smart/child/T315(EU)_1.0_1.7.0.json +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/__init__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/features/__init__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/__init__.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/smart/modules/test_lighttransition.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_childdevice.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_cli.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_device_factory.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_device_type.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_deviceconfig.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_plug.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_smartdevice.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/tests/test_strip.py +0 -0
- {python_kasa-0.7.1 → python_kasa-0.7.3}/kasa/xortransport.py +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Compiled python modules.
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.pyc
|
|
4
|
+
|
|
5
|
+
# Setuptools distribution folder.
|
|
6
|
+
/dist/
|
|
7
|
+
|
|
8
|
+
# Python egg metadata, regenerated from source files by setuptools.
|
|
9
|
+
/*.egg-info
|
|
10
|
+
/*.egg
|
|
11
|
+
|
|
12
|
+
# Coverage
|
|
13
|
+
.coverage
|
|
14
|
+
|
|
15
|
+
# Tox
|
|
16
|
+
.tox
|
|
17
|
+
.cache
|
|
18
|
+
|
|
19
|
+
# IntelliJ
|
|
20
|
+
.idea
|
|
21
|
+
|
|
22
|
+
# vscode
|
|
23
|
+
.vscode
|
|
24
|
+
|
|
25
|
+
# VirtualEnvs
|
|
26
|
+
venv
|
|
27
|
+
.venv
|
|
28
|
+
|
|
29
|
+
/build
|
|
30
|
+
docs/build
|
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.3](https://github.com/python-kasa/python-kasa/tree/0.7.3) (2024-09-10)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/python-kasa/python-kasa/compare/0.7.2...0.7.3)
|
|
6
|
+
|
|
7
|
+
**Release summary:**
|
|
8
|
+
|
|
9
|
+
- Migrate from `poetry` to `uv` for package/project management.
|
|
10
|
+
- Various minor code improvements
|
|
11
|
+
|
|
12
|
+
**Project maintenance:**
|
|
13
|
+
|
|
14
|
+
- Do not regenerate aes key pair [\#1114](https://github.com/python-kasa/python-kasa/pull/1114) (@sdb9696)
|
|
15
|
+
- Fix tests due to yarl URL str output change [\#1112](https://github.com/python-kasa/python-kasa/pull/1112) (@sdb9696)
|
|
16
|
+
- Add missing type hints to alarm module [\#1111](https://github.com/python-kasa/python-kasa/pull/1111) (@rytilahti)
|
|
17
|
+
- Add KH100 EU fixtures [\#1109](https://github.com/python-kasa/python-kasa/pull/1109) (@rytilahti)
|
|
18
|
+
- Migrate from poetry to uv for dependency and package management [\#986](https://github.com/python-kasa/python-kasa/pull/986) (@sdb9696)
|
|
19
|
+
|
|
20
|
+
## [0.7.2](https://github.com/python-kasa/python-kasa/tree/0.7.2) (2024-08-30)
|
|
21
|
+
|
|
22
|
+
[Full Changelog](https://github.com/python-kasa/python-kasa/compare/0.7.1...0.7.2)
|
|
23
|
+
|
|
24
|
+
**Release summary:**
|
|
25
|
+
|
|
26
|
+
- **Breaking** change to disable including the check for the latest firmware for tapo devices and newer kasa devices in the standard update cycle. To check for the latest firmware call `check_latest_firmware` on the firmware module or run the `check_latest_firmware` feature.
|
|
27
|
+
- Minor bugfixes and improvements.
|
|
28
|
+
|
|
29
|
+
**Breaking changes:**
|
|
30
|
+
|
|
31
|
+
- Disable automatic updating of latest firmware [\#1103](https://github.com/python-kasa/python-kasa/pull/1103) (@sdb9696)
|
|
32
|
+
|
|
33
|
+
**Implemented enhancements:**
|
|
34
|
+
|
|
35
|
+
- Improve performance of dict merge code [\#1097](https://github.com/python-kasa/python-kasa/pull/1097) (@bdraco)
|
|
36
|
+
|
|
37
|
+
**Fixed bugs:**
|
|
38
|
+
|
|
39
|
+
- Fix logging in iotdevice when a module is module not supported [\#1100](https://github.com/python-kasa/python-kasa/pull/1100) (@bdraco)
|
|
40
|
+
|
|
41
|
+
**Documentation updates:**
|
|
42
|
+
|
|
43
|
+
- Fix incorrect docs link in contributing.md [\#1099](https://github.com/python-kasa/python-kasa/pull/1099) (@sdb9696)
|
|
44
|
+
|
|
45
|
+
**Project maintenance:**
|
|
46
|
+
|
|
47
|
+
- Remove top level await xdoctest fixture [\#1098](https://github.com/python-kasa/python-kasa/pull/1098) (@sdb9696)
|
|
48
|
+
- Enable python 3.13, allow pre-releases for CI [\#1086](https://github.com/python-kasa/python-kasa/pull/1086) (@rytilahti)
|
|
49
|
+
- Add flake8-pytest-style \(PT\) for ruff [\#1105](https://github.com/python-kasa/python-kasa/pull/1105) (@rytilahti)
|
|
50
|
+
- Add flake8-logging \(LOG\) and flake8-logging-format \(G\) for ruff [\#1104](https://github.com/python-kasa/python-kasa/pull/1104) (@rytilahti)
|
|
51
|
+
- Add missing typing\_extensions dependency [\#1101](https://github.com/python-kasa/python-kasa/pull/1101) (@sdb9696)
|
|
52
|
+
|
|
3
53
|
## [0.7.1](https://github.com/python-kasa/python-kasa/tree/0.7.1) (2024-07-31)
|
|
4
54
|
|
|
5
55
|
[Full Changelog](https://github.com/python-kasa/python-kasa/compare/0.7.0.5...0.7.1)
|
|
@@ -17,6 +67,8 @@
|
|
|
17
67
|
|
|
18
68
|
**Fixed bugs:**
|
|
19
69
|
|
|
70
|
+
- Error connecting to L920-5 Smart LED Strip [\#1040](https://github.com/python-kasa/python-kasa/issues/1040)
|
|
71
|
+
- Handle module errors more robustly and add query params to light preset and transition [\#1036](https://github.com/python-kasa/python-kasa/pull/1036) (@sdb9696)
|
|
20
72
|
- Fix iot light effect brightness [\#1092](https://github.com/python-kasa/python-kasa/pull/1092) (@sdb9696)
|
|
21
73
|
- Enable setting brightness with color temp for smart devices [\#1091](https://github.com/python-kasa/python-kasa/pull/1091) (@sdb9696)
|
|
22
74
|
- Do not send light\_on value to iot bulb set\_state [\#1090](https://github.com/python-kasa/python-kasa/pull/1090) (@sdb9696)
|
|
@@ -24,7 +76,6 @@
|
|
|
24
76
|
- Raise KasaException on decryption errors [\#1078](https://github.com/python-kasa/python-kasa/pull/1078) (@sdb9696)
|
|
25
77
|
- Update smart request parameter handling [\#1061](https://github.com/python-kasa/python-kasa/pull/1061) (@sdb9696)
|
|
26
78
|
- Fix light preset module when list contains lighting effects [\#1048](https://github.com/python-kasa/python-kasa/pull/1048) (@sdb9696)
|
|
27
|
-
- Handle module errors more robustly and add query params to light preset and transition [\#1036](https://github.com/python-kasa/python-kasa/pull/1036) (@sdb9696)
|
|
28
79
|
- Fix credential hash to return None on empty credentials [\#1029](https://github.com/python-kasa/python-kasa/pull/1029) (@sdb9696)
|
|
29
80
|
|
|
30
81
|
**Added support for devices:**
|
|
@@ -34,6 +85,9 @@
|
|
|
34
85
|
**Project maintenance:**
|
|
35
86
|
|
|
36
87
|
- Bump project version to 0.7.0.5 [\#1087](https://github.com/python-kasa/python-kasa/pull/1087) (@sdb9696)
|
|
88
|
+
- Add KP400\(US\) v1.0.4 fixture [\#1051](https://github.com/python-kasa/python-kasa/pull/1051) (@gimpy88)
|
|
89
|
+
- Add new HS220 kasa aes fixture [\#1050](https://github.com/python-kasa/python-kasa/pull/1050) (@sdb9696)
|
|
90
|
+
- Add KS205\(US\) v1.1.0 fixture [\#1049](https://github.com/python-kasa/python-kasa/pull/1049) (@gimpy88)
|
|
37
91
|
- Fix generate\_supported pre commit to run in venv [\#1085](https://github.com/python-kasa/python-kasa/pull/1085) (@sdb9696)
|
|
38
92
|
- Fix intermittently failing decryption error test [\#1082](https://github.com/python-kasa/python-kasa/pull/1082) (@sdb9696)
|
|
39
93
|
- Fix mypy pre-commit hook on windows [\#1081](https://github.com/python-kasa/python-kasa/pull/1081) (@sdb9696)
|
|
@@ -42,9 +96,6 @@
|
|
|
42
96
|
- Fix parse\_pcap\_klap on windows and support default credentials [\#1068](https://github.com/python-kasa/python-kasa/pull/1068) (@sdb9696)
|
|
43
97
|
- Add fixture file for KP405 fw 1.0.6 [\#1063](https://github.com/python-kasa/python-kasa/pull/1063) (@daleye)
|
|
44
98
|
- Bump project version to 0.7.0.3 [\#1053](https://github.com/python-kasa/python-kasa/pull/1053) (@sdb9696)
|
|
45
|
-
- Add KP400\(US\) v1.0.4 fixture [\#1051](https://github.com/python-kasa/python-kasa/pull/1051) (@gimpy88)
|
|
46
|
-
- Add new HS220 kasa aes fixture [\#1050](https://github.com/python-kasa/python-kasa/pull/1050) (@sdb9696)
|
|
47
|
-
- Add KS205\(US\) v1.1.0 fixture [\#1049](https://github.com/python-kasa/python-kasa/pull/1049) (@gimpy88)
|
|
48
99
|
- Add KS200M\(US\) v1.0.11 fixture [\#1047](https://github.com/python-kasa/python-kasa/pull/1047) (@sdb9696)
|
|
49
100
|
- Add KS225\(US\) v1.1.0 fixture [\#1046](https://github.com/python-kasa/python-kasa/pull/1046) (@sdb9696)
|
|
50
101
|
- Split out main cli module into lazily loaded submodules [\#1039](https://github.com/python-kasa/python-kasa/pull/1039) (@sdb9696)
|
|
@@ -76,7 +127,6 @@ Critical bugfixes for issues with P100s and thermostats
|
|
|
76
127
|
|
|
77
128
|
**Fixed bugs:**
|
|
78
129
|
|
|
79
|
-
- Error connecting to L920-5 Smart LED Strip [\#1040](https://github.com/python-kasa/python-kasa/issues/1040)
|
|
80
130
|
- Use first known thermostat state as main state \(pick \#1054\) [\#1057](https://github.com/python-kasa/python-kasa/pull/1057) (@sdb9696)
|
|
81
131
|
- Defer module updates for less volatile modules \(pick 1052\) [\#1056](https://github.com/python-kasa/python-kasa/pull/1056) (@sdb9696)
|
|
82
132
|
- Use first known thermostat state as main state [\#1054](https://github.com/python-kasa/python-kasa/pull/1054) (@rytilahti)
|
|
@@ -945,6 +995,10 @@ Pull requests improving the functionality of modules as well as adding better in
|
|
|
945
995
|
- Improve poetry usage documentation [\#60](https://github.com/python-kasa/python-kasa/issues/60)
|
|
946
996
|
- Improve cli documentation for bulbs and power strips [\#123](https://github.com/python-kasa/python-kasa/pull/123) (@rytilahti)
|
|
947
997
|
|
|
998
|
+
**Project maintenance:**
|
|
999
|
+
|
|
1000
|
+
- Add HS220 hw 2.0 fixture [\#107](https://github.com/python-kasa/python-kasa/pull/107) (@appleguru)
|
|
1001
|
+
|
|
948
1002
|
**Merged pull requests:**
|
|
949
1003
|
|
|
950
1004
|
- Add github workflow for pypi publishing [\#220](https://github.com/python-kasa/python-kasa/pull/220) (@rytilahti)
|
|
@@ -967,7 +1021,6 @@ Pull requests improving the functionality of modules as well as adding better in
|
|
|
967
1021
|
- Fix documentation on Smart strips [\#136](https://github.com/python-kasa/python-kasa/pull/136) (@flavio-fernandes)
|
|
968
1022
|
- add tapo link, fix tplink-smarthome-simulator link [\#133](https://github.com/python-kasa/python-kasa/pull/133) (@rytilahti)
|
|
969
1023
|
- Leverage data from UDP discovery to initialize device structure [\#132](https://github.com/python-kasa/python-kasa/pull/132) (@dlee1j1)
|
|
970
|
-
- Add HS220 hw 2.0 fixture [\#107](https://github.com/python-kasa/python-kasa/pull/107) (@appleguru)
|
|
971
1024
|
- Pin dependencies on major versions, add poetry.lock [\#94](https://github.com/python-kasa/python-kasa/pull/94) (@rytilahti)
|
|
972
1025
|
- add a small example script to show library usage [\#90](https://github.com/python-kasa/python-kasa/pull/90) (@rytilahti)
|
|
973
1026
|
- add .readthedocs.yml required for poetry builds [\#89](https://github.com/python-kasa/python-kasa/pull/89) (@rytilahti)
|
|
@@ -1,37 +1,41 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: python-kasa
|
|
3
|
-
Version: 0.7.
|
|
4
|
-
Summary: Python API for TP-Link Kasa
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Version: 0.7.3
|
|
4
|
+
Summary: Python API for TP-Link Kasa and Tapo devices
|
|
5
|
+
Project-URL: Homepage, https://github.com/python-kasa/python-kasa
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/python-kasa/python-kasa/issues
|
|
7
|
+
Project-URL: Documentation, https://python-kasa.readthedocs.io
|
|
8
|
+
Project-URL: Repository, https://github.com/python-kasa/python-kasa
|
|
7
9
|
Author: python-kasa developers
|
|
8
|
-
|
|
10
|
+
License: GPL-3.0-or-later
|
|
11
|
+
License-File: LICENSE
|
|
9
12
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
10
14
|
Classifier: Programming Language :: Python :: 3
|
|
11
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
12
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Requires-Python: <4.0,>=3.9
|
|
21
|
+
Requires-Dist: aiohttp>=3
|
|
22
|
+
Requires-Dist: async-timeout>=3.0.0
|
|
23
|
+
Requires-Dist: asyncclick>=8.1.7
|
|
24
|
+
Requires-Dist: cryptography>=1.9
|
|
25
|
+
Requires-Dist: pydantic>=1.10.15
|
|
26
|
+
Requires-Dist: typing-extensions<5.0,>=4.12.2
|
|
15
27
|
Provides-Extra: docs
|
|
28
|
+
Requires-Dist: docutils>=0.17; extra == 'docs'
|
|
29
|
+
Requires-Dist: myst-parser; extra == 'docs'
|
|
30
|
+
Requires-Dist: sphinx-rtd-theme~=2.0; extra == 'docs'
|
|
31
|
+
Requires-Dist: sphinxcontrib-programoutput~=0.0; extra == 'docs'
|
|
32
|
+
Requires-Dist: sphinx~=5.0; extra == 'docs'
|
|
16
33
|
Provides-Extra: shell
|
|
34
|
+
Requires-Dist: ptpython; extra == 'shell'
|
|
35
|
+
Requires-Dist: rich; extra == 'shell'
|
|
17
36
|
Provides-Extra: speedups
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
Requires-Dist:
|
|
20
|
-
Requires-Dist: asyncclick (>=8.1.7)
|
|
21
|
-
Requires-Dist: cryptography (>=1.9)
|
|
22
|
-
Requires-Dist: docutils (>=0.17) ; extra == "docs"
|
|
23
|
-
Requires-Dist: kasa-crypt (>=0.2.0) ; extra == "speedups"
|
|
24
|
-
Requires-Dist: myst-parser ; extra == "docs"
|
|
25
|
-
Requires-Dist: orjson (>=3.9.1) ; extra == "speedups"
|
|
26
|
-
Requires-Dist: ptpython ; extra == "shell"
|
|
27
|
-
Requires-Dist: pydantic (>=1.10.15)
|
|
28
|
-
Requires-Dist: rich ; extra == "shell"
|
|
29
|
-
Requires-Dist: sphinx (>=5,<6) ; extra == "docs"
|
|
30
|
-
Requires-Dist: sphinx_rtd_theme (>=2,<3) ; extra == "docs"
|
|
31
|
-
Requires-Dist: sphinxcontrib-programoutput (>=0,<1) ; extra == "docs"
|
|
32
|
-
Project-URL: Bug Tracker, https://github.com/python-kasa/python-kasa/issues
|
|
33
|
-
Project-URL: Documentation, https://python-kasa.readthedocs.io
|
|
34
|
-
Project-URL: Repository, https://github.com/python-kasa/python-kasa
|
|
37
|
+
Requires-Dist: kasa-crypt>=0.2.0; extra == 'speedups'
|
|
38
|
+
Requires-Dist: orjson>=3.9.1; extra == 'speedups'
|
|
35
39
|
Description-Content-Type: text/markdown
|
|
36
40
|
|
|
37
41
|
# python-kasa
|
|
@@ -56,11 +60,12 @@ You can install the most recent release using pip:
|
|
|
56
60
|
pip install python-kasa
|
|
57
61
|
```
|
|
58
62
|
|
|
59
|
-
Alternatively, you can clone this repository and use
|
|
63
|
+
Alternatively, you can clone this repository and use `uv` to install the development version:
|
|
60
64
|
```
|
|
61
65
|
git clone https://github.com/python-kasa/python-kasa.git
|
|
62
66
|
cd python-kasa/
|
|
63
|
-
|
|
67
|
+
uv sync --all-extras
|
|
68
|
+
uv run kasa
|
|
64
69
|
```
|
|
65
70
|
|
|
66
71
|
If you have not yet provisioned your device, [you can do so using the cli tool](https://python-kasa.readthedocs.io/en/latest/cli.html#provisioning).
|
|
@@ -263,4 +268,3 @@ See [supported devices in our documentation](SUPPORTED.md) for more detailed inf
|
|
|
263
268
|
* [plugp100, another tapo library](https://github.com/petretiandrea/plugp100)
|
|
264
269
|
* [Home Assistant integration](https://github.com/petretiandrea/home-assistant-tapo-p100)
|
|
265
270
|
* [rust and python implementation for tapo devices](https://github.com/mihai-dinculescu/tapo/)
|
|
266
|
-
|
|
@@ -20,11 +20,12 @@ You can install the most recent release using pip:
|
|
|
20
20
|
pip install python-kasa
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Alternatively, you can clone this repository and use
|
|
23
|
+
Alternatively, you can clone this repository and use `uv` to install the development version:
|
|
24
24
|
```
|
|
25
25
|
git clone https://github.com/python-kasa/python-kasa.git
|
|
26
26
|
cd python-kasa/
|
|
27
|
-
|
|
27
|
+
uv sync --all-extras
|
|
28
|
+
uv run kasa
|
|
28
29
|
```
|
|
29
30
|
|
|
30
31
|
If you have not yet provisioned your device, [you can do so using the cli tool](https://python-kasa.readthedocs.io/en/latest/cli.html#provisioning).
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Tools for developers
|
|
2
|
+
|
|
3
|
+
This directory contains some simple scripts that can be useful for developers.
|
|
4
|
+
|
|
5
|
+
## dump_devinfo
|
|
6
|
+
* Queries the device (if --host is given) or discover devices and creates fixture files that can be added to the test suite.
|
|
7
|
+
|
|
8
|
+
```shell
|
|
9
|
+
Usage: python -m devtools.dump_devinfo [OPTIONS]
|
|
10
|
+
|
|
11
|
+
Generate devinfo files for devices.
|
|
12
|
+
|
|
13
|
+
Use --host (for a single device) or --target (for a complete network).
|
|
14
|
+
|
|
15
|
+
Options:
|
|
16
|
+
--host TEXT Target host.
|
|
17
|
+
--target TEXT Target network for discovery.
|
|
18
|
+
--username TEXT Username/email address to authenticate to device.
|
|
19
|
+
--password TEXT Password to use to authenticate to device.
|
|
20
|
+
--basedir TEXT Base directory for the git repository
|
|
21
|
+
--autosave Save without prompting
|
|
22
|
+
-d, --debug
|
|
23
|
+
--help Show this message and exit.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## create_module_fixtures
|
|
27
|
+
|
|
28
|
+
* Queries the device for all supported modules and outputs module-based fixture files for each device.
|
|
29
|
+
* This could be used to create fixture files for module-specific tests, but it might also be useful for other use-cases.
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
Usage: create_module_fixtures.py [OPTIONS] OUTPUTDIR
|
|
33
|
+
|
|
34
|
+
Create module fixtures for given host/network.
|
|
35
|
+
|
|
36
|
+
Arguments:
|
|
37
|
+
OUTPUTDIR [required]
|
|
38
|
+
|
|
39
|
+
Options:
|
|
40
|
+
--host TEXT
|
|
41
|
+
--network TEXT
|
|
42
|
+
--install-completion Install completion for the current shell.
|
|
43
|
+
--show-completion Show completion for the current shell, to copy it or
|
|
44
|
+
customize the installation.
|
|
45
|
+
--help Show this message and exit.
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## parse_pcap
|
|
49
|
+
|
|
50
|
+
* Requires dpkt (pip install dpkt)
|
|
51
|
+
* Reads a pcap file and prints out the device communications
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
Usage: parse_pcap.py [OPTIONS] FILE
|
|
55
|
+
|
|
56
|
+
Parse pcap file and pretty print the communications and some statistics.
|
|
57
|
+
|
|
58
|
+
Options:
|
|
59
|
+
--help Show this message and exit.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## perftest
|
|
63
|
+
|
|
64
|
+
* Runs several rounds of update cycles for the given list of addresses, and prints out statistics about the performance
|
|
65
|
+
|
|
66
|
+
```shell
|
|
67
|
+
Usage: perf_test.py [OPTIONS] [ADDRS]...
|
|
68
|
+
|
|
69
|
+
Options:
|
|
70
|
+
--rounds INTEGER
|
|
71
|
+
--help Show this message and exit.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```shell
|
|
75
|
+
$ python perf_test.py 192.168.xx.x 192.168.xx.y 192.168.xx.z 192.168.xx.f
|
|
76
|
+
Running 5 rounds on ('192.168.xx.x', '192.168.xx.y', '192.168.xx.z', '192.168.xx.f')
|
|
77
|
+
=== Testing using gather on all devices ===
|
|
78
|
+
took
|
|
79
|
+
count mean std min 25% 50% 75% max
|
|
80
|
+
type
|
|
81
|
+
concurrently 5.0 0.097161 0.045544 0.05260 0.055332 0.088811 0.143082 0.145981
|
|
82
|
+
sequential 5.0 0.150506 0.005798 0.14162 0.149065 0.150499 0.155579 0.155768
|
|
83
|
+
=== Testing per-device performance ===
|
|
84
|
+
took
|
|
85
|
+
count mean std min 25% 50% 75% max
|
|
86
|
+
id
|
|
87
|
+
<id>-HS110(EU) 5.0 0.044917 0.014984 0.035836 0.037728 0.037950 0.041610 0.071458
|
|
88
|
+
<id>-KL130(EU) 5.0 0.067626 0.032027 0.046451 0.046797 0.048406 0.076136 0.120342
|
|
89
|
+
<id>-HS110(EU) 5.0 0.055700 0.016174 0.042086 0.045578 0.048905 0.059869 0.082064
|
|
90
|
+
<id>-KP303(UK) 5.0 0.010298 0.003765 0.007773 0.007968 0.008546 0.010439 0.016763
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## benchmark
|
|
94
|
+
|
|
95
|
+
* Benchmark the protocol
|
|
96
|
+
|
|
97
|
+
```shell
|
|
98
|
+
% python3 devtools/bench/benchmark.py
|
|
99
|
+
New parser, parsing 100000 messages took 0.6339647499989951 seconds
|
|
100
|
+
Old parser, parsing 100000 messages took 9.473990250000497 seconds
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## parse_pcap_klap
|
|
105
|
+
|
|
106
|
+
* A tool to allow KLAP data to be exported, in JSON, from a PCAP file of encrypted requests.
|
|
107
|
+
|
|
108
|
+
* NOTE: must install pyshark (`pip install pyshark`).
|
|
109
|
+
* pyshark requires Wireshark or tshark to be installed on windows and tshark to be installed
|
|
110
|
+
on linux (`apt get tshark`)
|
|
111
|
+
|
|
112
|
+
```shell
|
|
113
|
+
Usage: parse_pcap_klap.py [OPTIONS]
|
|
114
|
+
|
|
115
|
+
Export KLAP data in JSON format from a PCAP file.
|
|
116
|
+
|
|
117
|
+
Options:
|
|
118
|
+
--host TEXT the IP of the smart device as it appears in the pcap
|
|
119
|
+
file. [required]
|
|
120
|
+
--username TEXT Username/email address to authenticate to device.
|
|
121
|
+
[required]
|
|
122
|
+
--password TEXT Password to use to authenticate to device.
|
|
123
|
+
[required]
|
|
124
|
+
--pcap-file-path TEXT The path to the pcap file to parse. [required]
|
|
125
|
+
-o, --output TEXT The name of the output file, relative to the current
|
|
126
|
+
directory.
|
|
127
|
+
--help Show this message and exit.
|
|
128
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Devtools package."""
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Benchmark the new parser against the old parser."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import timeit
|
|
5
|
+
|
|
6
|
+
import orjson
|
|
7
|
+
from kasa_crypt import decrypt, encrypt
|
|
8
|
+
|
|
9
|
+
from devtools.bench.utils.data import REQUEST, WIRE_RESPONSE
|
|
10
|
+
from devtools.bench.utils.original import OriginalTPLinkSmartHomeProtocol
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def original_request_response() -> None:
|
|
14
|
+
"""Benchmark the original parser."""
|
|
15
|
+
OriginalTPLinkSmartHomeProtocol.encrypt(json.dumps(REQUEST))
|
|
16
|
+
json.loads(OriginalTPLinkSmartHomeProtocol.decrypt(WIRE_RESPONSE[4:]))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def new_request_response() -> None:
|
|
20
|
+
"""Benchmark the new parser."""
|
|
21
|
+
encrypt(orjson.dumps(REQUEST).decode())
|
|
22
|
+
orjson.loads(decrypt(WIRE_RESPONSE[4:]))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
count = 100000
|
|
26
|
+
|
|
27
|
+
time = timeit.Timer(new_request_response).timeit(count)
|
|
28
|
+
print(f"New parser, parsing {count} messages took {time} seconds")
|
|
29
|
+
|
|
30
|
+
time = timeit.Timer(original_request_response).timeit(count)
|
|
31
|
+
print(f"Old parser, parsing {count} messages took {time} seconds")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Benchmark utils."""
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""Test data for benchmarks."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
from .original import OriginalTPLinkSmartHomeProtocol
|
|
6
|
+
|
|
7
|
+
REQUEST = {
|
|
8
|
+
"system": {"get_sysinfo": None},
|
|
9
|
+
"anti_theft": {"get_rules": None, "get_next_action": None},
|
|
10
|
+
"schedule": {
|
|
11
|
+
"get_rules": None,
|
|
12
|
+
"get_next_action": None,
|
|
13
|
+
"get_realtime": None,
|
|
14
|
+
"get_daystat": {"year": 2023, "month": 6},
|
|
15
|
+
"get_monthstat": {"year": 2023},
|
|
16
|
+
},
|
|
17
|
+
"time": {"get_time": None, "get_timezone": None},
|
|
18
|
+
"emeter": {
|
|
19
|
+
"get_realtime": None,
|
|
20
|
+
"get_daystat": {"year": 2023, "month": 6},
|
|
21
|
+
"get_monthstat": {"year": 2023},
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
RESPONSE = {
|
|
25
|
+
"anti_theft": {
|
|
26
|
+
"get_next_action": {"err_code": -2, "err_msg": "member not support"},
|
|
27
|
+
"get_rules": {"enable": 0, "err_code": 0, "rule_list": [], "version": 2},
|
|
28
|
+
},
|
|
29
|
+
"emeter": {
|
|
30
|
+
"get_daystat": {
|
|
31
|
+
"day_list": [{"day": 30, "energy_wh": 0, "month": 6, "year": 2023}],
|
|
32
|
+
"err_code": 0,
|
|
33
|
+
},
|
|
34
|
+
"get_monthstat": {
|
|
35
|
+
"err_code": 0,
|
|
36
|
+
"month_list": [{"energy_wh": 0, "month": 6, "year": 2023}],
|
|
37
|
+
},
|
|
38
|
+
"get_realtime": {
|
|
39
|
+
"current_ma": 0,
|
|
40
|
+
"err_code": 0,
|
|
41
|
+
"power_mw": 0,
|
|
42
|
+
"slot_id": 0,
|
|
43
|
+
"total_wh": 0,
|
|
44
|
+
"voltage_mv": 119390,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
"schedule": {
|
|
48
|
+
"get_daystat": {
|
|
49
|
+
"day_list": [{"day": 30, "month": 6, "time": 3, "year": 2023}],
|
|
50
|
+
"err_code": 0,
|
|
51
|
+
},
|
|
52
|
+
"get_monthstat": {
|
|
53
|
+
"err_code": 0,
|
|
54
|
+
"month_list": [{"month": 6, "time": 3, "year": 2023}],
|
|
55
|
+
},
|
|
56
|
+
"get_next_action": {"err_code": 0, "type": -1},
|
|
57
|
+
"get_realtime": {"err_code": -2, "err_msg": "member not support"},
|
|
58
|
+
"get_rules": {"enable": 1, "err_code": 0, "rule_list": [], "version": 2},
|
|
59
|
+
},
|
|
60
|
+
"system": {
|
|
61
|
+
"get_sysinfo": {
|
|
62
|
+
"alias": "TP-LINK_Power Strip_5C33",
|
|
63
|
+
"child_num": 6,
|
|
64
|
+
"children": [
|
|
65
|
+
{
|
|
66
|
+
"alias": "Plug 1",
|
|
67
|
+
"id": "8006AF35494E7DB13DDE9B8F40BF2E001E77031900",
|
|
68
|
+
"next_action": {"type": -1},
|
|
69
|
+
"on_time": 231,
|
|
70
|
+
"state": 1,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"alias": "Plug 2",
|
|
74
|
+
"id": "8006AF35494E7DB13DDE9B8F40BF2E001E77031901",
|
|
75
|
+
"next_action": {"type": -1},
|
|
76
|
+
"on_time": 231,
|
|
77
|
+
"state": 1,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"alias": "Plug 3",
|
|
81
|
+
"id": "8006AF35494E7DB13DDE9B8F40BF2E001E77031902",
|
|
82
|
+
"next_action": {"type": -1},
|
|
83
|
+
"on_time": 231,
|
|
84
|
+
"state": 1,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"alias": "Plug 4",
|
|
88
|
+
"id": "8006AF35494E7DB13DDE9B8F40BF2E001E77031903",
|
|
89
|
+
"next_action": {"type": -1},
|
|
90
|
+
"on_time": 231,
|
|
91
|
+
"state": 1,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"alias": "Plug 5",
|
|
95
|
+
"id": "8006AF35494E7DB13DDE9B8F40BF2E001E77031904",
|
|
96
|
+
"next_action": {"type": -1},
|
|
97
|
+
"on_time": 231,
|
|
98
|
+
"state": 1,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"alias": "Plug 6",
|
|
102
|
+
"id": "8006AF35494E7DB13DDE9B8F40BF2E001E77031905",
|
|
103
|
+
"next_action": {"type": -1},
|
|
104
|
+
"on_time": 231,
|
|
105
|
+
"state": 1,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
"deviceId": "8006AF35494E7DB13DDE9B8F40BF2E001E770319",
|
|
109
|
+
"err_code": 0,
|
|
110
|
+
"feature": "TIM:ENE",
|
|
111
|
+
"hwId": "955F433CBA24823A248A59AA64571A73",
|
|
112
|
+
"hw_ver": "2.0",
|
|
113
|
+
"latitude_i": 297852,
|
|
114
|
+
"led_off": 0,
|
|
115
|
+
"longitude_i": -954074,
|
|
116
|
+
"mac": "C0:06:C3:42:5C:33",
|
|
117
|
+
"mic_type": "IOT.SMARTPLUGSWITCH",
|
|
118
|
+
"model": "HS300(US)",
|
|
119
|
+
"oemId": "32BD0B21AA9BF8E84737D1DB1C66E883",
|
|
120
|
+
"rssi": -41,
|
|
121
|
+
"status": "new",
|
|
122
|
+
"sw_ver": "1.0.3 Build 201203 Rel.165457",
|
|
123
|
+
"updating": 0,
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"time": {
|
|
127
|
+
"get_time": {
|
|
128
|
+
"err_code": 0,
|
|
129
|
+
"hour": 9,
|
|
130
|
+
"mday": 30,
|
|
131
|
+
"min": 32,
|
|
132
|
+
"month": 6,
|
|
133
|
+
"sec": 54,
|
|
134
|
+
"year": 2023,
|
|
135
|
+
},
|
|
136
|
+
"get_timezone": {"err_code": 0, "index": 13},
|
|
137
|
+
},
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
WIRE_RESPONSE = OriginalTPLinkSmartHomeProtocol.encrypt(json.dumps(RESPONSE))
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Original implementation of the TP-Link Smart Home protocol."""
|
|
2
|
+
|
|
3
|
+
import struct
|
|
4
|
+
from typing import Generator
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class OriginalTPLinkSmartHomeProtocol:
|
|
8
|
+
"""Original implementation of the TP-Link Smart Home protocol."""
|
|
9
|
+
|
|
10
|
+
INITIALIZATION_VECTOR = 171
|
|
11
|
+
|
|
12
|
+
@staticmethod
|
|
13
|
+
def _xor_payload(unencrypted: bytes) -> Generator[int, None, None]:
|
|
14
|
+
key = OriginalTPLinkSmartHomeProtocol.INITIALIZATION_VECTOR
|
|
15
|
+
for unencryptedbyte in unencrypted:
|
|
16
|
+
key = key ^ unencryptedbyte
|
|
17
|
+
yield key
|
|
18
|
+
|
|
19
|
+
@staticmethod
|
|
20
|
+
def encrypt(request: str) -> bytes:
|
|
21
|
+
"""Encrypt a request for a TP-Link Smart Home Device.
|
|
22
|
+
|
|
23
|
+
:param request: plaintext request data
|
|
24
|
+
:return: ciphertext to be send over wire, in bytes
|
|
25
|
+
"""
|
|
26
|
+
plainbytes = request.encode()
|
|
27
|
+
return struct.pack(">I", len(plainbytes)) + bytes(
|
|
28
|
+
OriginalTPLinkSmartHomeProtocol._xor_payload(plainbytes)
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
@staticmethod
|
|
32
|
+
def _xor_encrypted_payload(ciphertext: bytes) -> Generator[int, None, None]:
|
|
33
|
+
key = OriginalTPLinkSmartHomeProtocol.INITIALIZATION_VECTOR
|
|
34
|
+
for cipherbyte in ciphertext:
|
|
35
|
+
plainbyte = key ^ cipherbyte
|
|
36
|
+
key = cipherbyte
|
|
37
|
+
yield plainbyte
|
|
38
|
+
|
|
39
|
+
@staticmethod
|
|
40
|
+
def decrypt(ciphertext: bytes) -> str:
|
|
41
|
+
"""Decrypt a response of a TP-Link Smart Home Device.
|
|
42
|
+
|
|
43
|
+
:param ciphertext: encrypted response data
|
|
44
|
+
:return: plaintext response
|
|
45
|
+
"""
|
|
46
|
+
return bytes(
|
|
47
|
+
OriginalTPLinkSmartHomeProtocol._xor_encrypted_payload(ciphertext)
|
|
48
|
+
).decode()
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""Create fixture files for modules supported by a device.
|
|
2
|
+
|
|
3
|
+
This script can be used to create fixture files for individual modules.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import asyncio
|
|
7
|
+
import json
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import cast
|
|
10
|
+
|
|
11
|
+
import typer
|
|
12
|
+
|
|
13
|
+
from kasa import Discover
|
|
14
|
+
from kasa.iot import IotDevice
|
|
15
|
+
|
|
16
|
+
app = typer.Typer()
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def create_fixtures(dev: IotDevice, outputdir: Path):
|
|
20
|
+
"""Iterate over supported modules and create version-specific fixture files."""
|
|
21
|
+
for name, module in dev.modules.items():
|
|
22
|
+
module_dir = outputdir / str(name)
|
|
23
|
+
if not module_dir.exists():
|
|
24
|
+
module_dir.mkdir(exist_ok=True, parents=True)
|
|
25
|
+
|
|
26
|
+
sw_version = dev.hw_info["sw_ver"]
|
|
27
|
+
sw_version = sw_version.split(" ", maxsplit=1)[0]
|
|
28
|
+
filename = f"{dev.model}_{dev.hw_info['hw_ver']}_{sw_version}.json"
|
|
29
|
+
module_file = module_dir / filename
|
|
30
|
+
|
|
31
|
+
if module_file.exists():
|
|
32
|
+
continue
|
|
33
|
+
|
|
34
|
+
typer.echo(f"Creating {module_file} for {dev.model}")
|
|
35
|
+
with module_file.open("w") as f:
|
|
36
|
+
json.dump(module.data, f, indent=4)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@app.command()
|
|
40
|
+
def create_module_fixtures(
|
|
41
|
+
outputdir: Path,
|
|
42
|
+
host: str = typer.Option(default=None),
|
|
43
|
+
network: str = typer.Option(default=None),
|
|
44
|
+
):
|
|
45
|
+
"""Create module fixtures for given host/network."""
|
|
46
|
+
devs = []
|
|
47
|
+
if host is not None:
|
|
48
|
+
dev: IotDevice = cast(IotDevice, asyncio.run(Discover.discover_single(host)))
|
|
49
|
+
devs.append(dev)
|
|
50
|
+
else:
|
|
51
|
+
if network is None:
|
|
52
|
+
network = "255.255.255.255"
|
|
53
|
+
devs = asyncio.run(Discover.discover(target=network)).values()
|
|
54
|
+
for dev in devs:
|
|
55
|
+
dev = cast(IotDevice, dev)
|
|
56
|
+
asyncio.run(dev.update())
|
|
57
|
+
|
|
58
|
+
for dev in devs:
|
|
59
|
+
create_fixtures(dev, outputdir)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
if __name__ == "__main__":
|
|
63
|
+
app()
|