python-kasa 0.7.0.dev0__tar.gz → 0.7.0.dev2__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.0.dev0 → python_kasa-0.7.0.dev2}/CHANGELOG.md +44 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/PKG-INFO +4 -4
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/README.md +3 -3
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/__init__.py +19 -10
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/aestransport.py +0 -3
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/cli.py +12 -10
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/device.py +34 -3
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/deviceconfig.py +45 -20
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/discover.py +106 -46
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/feature.py +2 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/httpclient.py +24 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/interfaces/light.py +6 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/iotbulb.py +3 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/iotdevice.py +20 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/iotdimmer.py +3 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/iotlightstrip.py +3 -2
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/iotplug.py +1 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/iotstrip.py +1 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/light.py +46 -4
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/lightpreset.py +6 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/autooff.py +13 -8
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/light.py +28 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smartprotocol.py +3 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/device_fixtures.py +10 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/discovery_fixtures.py +82 -29
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fakeprotocol_iot.py +30 -7
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS110(EU)_1.0_1.2.5.json +1 -1
- python_kasa-0.7.0.dev2/kasa/tests/fixtures/HS110(US)_1.0_1.2.6.json +37 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS220(US)_1.0_1.5.7.json +1 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS220(US)_2.0_1.0.3.json +1 -1
- python_kasa-0.7.0.dev2/kasa/tests/fixtures/HS300(US)_1.0_1.0.21.json +89 -0
- python_kasa-0.7.0.dev2/kasa/tests/fixtures/KL120(US)_1.0_1.8.11.json +85 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL430(US)_1.0_1.0.10.json +51 -12
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP303(UK)_1.0_1.0.3.json +1 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.1.6.json +1 -1
- python_kasa-0.7.0.dev2/kasa/tests/fixtures/smart/P115(EU)_1.0_1.2.3.json +386 -0
- python_kasa-0.7.0.dev2/kasa/tests/fixtures/smart/S505D(US)_1.0_1.1.0.json +262 -0
- python_kasa-0.7.0.dev2/kasa/tests/smart/modules/test_autooff.py +103 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_aestransport.py +78 -2
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_bulb.py +10 -5
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_common_modules.py +28 -2
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_device.py +28 -6
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_device_factory.py +8 -8
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_dimmer.py +9 -9
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_discovery.py +61 -4
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_readme_examples.py +37 -22
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_smartprotocol.py +3 -2
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/pyproject.toml +1 -1
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/LICENSE +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/credentials.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/device_factory.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/device_type.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/emeterstatus.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/exceptions.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/interfaces/__init__.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/interfaces/fan.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/interfaces/led.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/interfaces/lighteffect.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/interfaces/lightpreset.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/__init__.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/effects.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/iotmodule.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/__init__.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/ambientlight.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/antitheft.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/cloud.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/countdown.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/emeter.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/led.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/lighteffect.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/motion.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/rulemodule.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/schedule.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/time.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iot/modules/usage.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/iotprotocol.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/json.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/klaptransport.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/module.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/modulemapping.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/modulemapping.pyi +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/protocol.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/py.typed +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/__init__.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/effects.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/__init__.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/alarm.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/batterysensor.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/brightness.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/childdevice.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/cloud.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/color.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/colortemperature.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/contactsensor.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/devicemodule.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/energy.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/fan.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/firmware.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/frostprotection.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/humiditysensor.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/led.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/lighteffect.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/lightpreset.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/lightstripeffect.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/lighttransition.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/reportmode.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/temperaturecontrol.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/temperaturesensor.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/time.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/modules/waterleaksensor.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/smartchilddevice.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/smartdevice.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/smart/smartmodule.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/__init__.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/conftest.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fakeprotocol_smart.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtureinfo.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/EP10(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/EP40(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/ES20M(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS100(UK)_1.0_1.2.6.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS100(UK)_4.1_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS100(US)_1.0_1.2.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS100(US)_2.0_1.5.6.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS103(US)_1.0_1.5.7.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS103(US)_2.1_1.1.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS103(US)_2.1_1.1.4.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS105(US)_1.0_1.5.6.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS107(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS110(EU)_4.0_1.0.4.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS200(US)_2.0_1.5.7.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS200(US)_5.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS210(US)_1.0_1.5.8.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS300(US)_1.0_1.0.10.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS300(US)_2.0_1.0.12.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/HS300(US)_2.0_1.0.3.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL110(US)_1.0_1.8.11.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL120(US)_1.0_1.8.6.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL125(US)_1.20_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL125(US)_2.0_1.0.7.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL125(US)_4.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL130(EU)_1.0_1.8.8.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL130(US)_1.0_1.8.11.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL135(US)_1.0_1.0.6.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL400L5(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL400L5(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL420L5(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL430(UN)_2.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL430(US)_2.0_1.0.11.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL430(US)_2.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL430(US)_2.0_1.0.9.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL50(US)_1.0_1.1.13.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL60(UN)_1.0_1.1.4.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KL60(US)_1.0_1.1.13.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP100(US)_3.0_1.0.1.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP105(UK)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP105(UK)_1.0_1.0.7.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP115(EU)_1.0_1.0.16.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP115(US)_1.0_1.0.17.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP115(US)_1.0_1.0.21.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP125(US)_1.0_1.0.6.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP200(US)_3.0_1.0.3.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP303(US)_2.0_1.0.3.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP400(US)_1.0_1.0.10.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP400(US)_2.0_1.0.6.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP401(US)_1.0_1.0.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KP405(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KS200M(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KS220M(US)_1.0_1.0.4.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/KS230(US)_1.0_1.0.14.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/LB110(US)_1.0_1.8.11.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.1.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.2.3.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.10.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/KH100(UK)_1.0_1.5.6.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/KP125M(US)_1.0_1.1.3.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/KS205(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/KS225(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/KS240(US)_1.0_1.0.4.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/KS240(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L510B(EU)_3.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L510E(US)_3.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L510E(US)_3.0_1.1.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.0.6.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L530E(US)_2.0_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L900-10(EU)_1.0_1.0.17.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L900-10(US)_1.0_1.0.11.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L900-5(EU)_1.0_1.0.17.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L900-5(EU)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L920-5(US)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L920-5(US)_1.0_1.1.3.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/L930-5(US)_1.0_1.1.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/P100_1.0.0_1.1.3.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/P100_1.0.0_1.3.7.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/P100_1.0.0_1.4.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/P110(EU)_1.0_1.0.7.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/P110(EU)_1.0_1.2.3.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/P110(UK)_1.0_1.3.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/P125M(US)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/P135(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.13.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.7.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/S500D(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/S505(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/TP15(US)_1.0_1.0.3.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/TP25(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/child/KE100(EU)_1.0_2.4.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/child/KE100(EU)_1.0_2.8.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/child/KE100(UK)_1.0_2.8.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/child/T110(EU)_1.0_1.8.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/child/T300(EU)_1.0_1.7.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/child/T310(EU)_1.0_1.5.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/fixtures/smart/child/T315(EU)_1.0_1.7.0.json +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/__init__.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/features/__init__.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/features/test_brightness.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/features/test_colortemp.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/modules/__init__.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/modules/test_contact.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/modules/test_fan.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/modules/test_firmware.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/modules/test_humidity.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/modules/test_light_effect.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/modules/test_temperature.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/modules/test_temperaturecontrol.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/smart/modules/test_waterleak.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_childdevice.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_cli.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_device_type.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_deviceconfig.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_emeter.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_feature.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_httpclient.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_iotdevice.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_klapprotocol.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_lightstrip.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_plug.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_protocol.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_smartdevice.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_strip.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/tests/test_usage.py +0 -0
- {python_kasa-0.7.0.dev0 → python_kasa-0.7.0.dev2}/kasa/xortransport.py +0 -0
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.0.dev2](https://github.com/python-kasa/python-kasa/tree/0.7.0.dev2) (2024-06-05)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/python-kasa/python-kasa/compare/0.7.0.dev1...0.7.0.dev2)
|
|
6
|
+
|
|
7
|
+
**Implemented enhancements:**
|
|
8
|
+
|
|
9
|
+
- Make device initialisation easier by reducing required imports [\#936](https://github.com/python-kasa/python-kasa/pull/936) (@sdb9696)
|
|
10
|
+
|
|
11
|
+
**Fixed bugs:**
|
|
12
|
+
|
|
13
|
+
- Do not raise on multi-request errors on child devices [\#949](https://github.com/python-kasa/python-kasa/pull/949) (@rytilahti)
|
|
14
|
+
- Do not show a zero error code when cli exits from showing help [\#935](https://github.com/python-kasa/python-kasa/pull/935) (@rytilahti)
|
|
15
|
+
- Initialize autooff features only when data is available [\#933](https://github.com/python-kasa/python-kasa/pull/933) (@rytilahti)
|
|
16
|
+
- Fix P100 errors on multi-requests [\#930](https://github.com/python-kasa/python-kasa/pull/930) (@sdb9696)
|
|
17
|
+
|
|
18
|
+
**Documentation updates:**
|
|
19
|
+
|
|
20
|
+
- Update documentation structure and start migrating to markdown [\#934](https://github.com/python-kasa/python-kasa/pull/934) (@sdb9696)
|
|
21
|
+
|
|
22
|
+
**Closed issues:**
|
|
23
|
+
|
|
24
|
+
- Simplify instance creation API [\#927](https://github.com/python-kasa/python-kasa/issues/927)
|
|
25
|
+
|
|
26
|
+
**Merged pull requests:**
|
|
27
|
+
|
|
28
|
+
- Add P115 fixture [\#950](https://github.com/python-kasa/python-kasa/pull/950) (@rytilahti)
|
|
29
|
+
- Add some device fixtures [\#948](https://github.com/python-kasa/python-kasa/pull/948) (@rytilahti)
|
|
30
|
+
- Add fixture for S505D [\#947](https://github.com/python-kasa/python-kasa/pull/947) (@rytilahti)
|
|
31
|
+
- Fix passing custom port for dump\_devinfo [\#938](https://github.com/python-kasa/python-kasa/pull/938) (@rytilahti)
|
|
32
|
+
|
|
33
|
+
## [0.7.0.dev1](https://github.com/python-kasa/python-kasa/tree/0.7.0.dev1) (2024-05-22)
|
|
34
|
+
|
|
35
|
+
[Full Changelog](https://github.com/python-kasa/python-kasa/compare/0.7.0.dev0...0.7.0.dev1)
|
|
36
|
+
|
|
37
|
+
**Implemented enhancements:**
|
|
38
|
+
|
|
39
|
+
- Fix set\_state for common light modules [\#929](https://github.com/python-kasa/python-kasa/pull/929) (@sdb9696)
|
|
40
|
+
- Add state feature for iot devices [\#924](https://github.com/python-kasa/python-kasa/pull/924) (@rytilahti)
|
|
41
|
+
|
|
42
|
+
**Merged pull requests:**
|
|
43
|
+
|
|
44
|
+
- Prepare 0.7.0.dev1 [\#931](https://github.com/python-kasa/python-kasa/pull/931) (@rytilahti)
|
|
45
|
+
|
|
3
46
|
## [0.7.0.dev0](https://github.com/python-kasa/python-kasa/tree/0.7.0.dev0) (2024-05-19)
|
|
4
47
|
|
|
5
48
|
[Full Changelog](https://github.com/python-kasa/python-kasa/compare/0.6.2.1...0.7.0.dev0)
|
|
@@ -120,6 +163,7 @@
|
|
|
120
163
|
|
|
121
164
|
**Merged pull requests:**
|
|
122
165
|
|
|
166
|
+
- Prepare 0.7.0.dev0 [\#922](https://github.com/python-kasa/python-kasa/pull/922) (@rytilahti)
|
|
123
167
|
- Fix potential infinite loop if incomplete lists returned [\#920](https://github.com/python-kasa/python-kasa/pull/920) (@sdb9696)
|
|
124
168
|
- Deprecate device level light, effect and led attributes [\#916](https://github.com/python-kasa/python-kasa/pull/916) (@sdb9696)
|
|
125
169
|
- Update cli to use common modules and remove iot specific cli testing [\#913](https://github.com/python-kasa/python-kasa/pull/913) (@sdb9696)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-kasa
|
|
3
|
-
Version: 0.7.0.
|
|
3
|
+
Version: 0.7.0.dev2
|
|
4
4
|
Summary: Python API for TP-Link Kasa Smarthome devices
|
|
5
5
|
Home-page: https://github.com/python-kasa/python-kasa
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -36,7 +36,7 @@ Project-URL: Documentation, https://python-kasa.readthedocs.io
|
|
|
36
36
|
Project-URL: Repository, https://github.com/python-kasa/python-kasa
|
|
37
37
|
Description-Content-Type: text/markdown
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
# python-kasa
|
|
40
40
|
|
|
41
41
|
[](https://badge.fury.io/py/python-kasa)
|
|
42
42
|
[](https://github.com/python-kasa/python-kasa/actions/workflows/ci.yml)
|
|
@@ -245,9 +245,9 @@ The following devices have been tested and confirmed as working. If your device
|
|
|
245
245
|
|
|
246
246
|
### Supported Tapo<sup>\*</sup> devices
|
|
247
247
|
|
|
248
|
-
- **Plugs**: P100, P110, P125M, P135, TP15
|
|
248
|
+
- **Plugs**: P100, P110, P115, P125M, P135, TP15
|
|
249
249
|
- **Power Strips**: P300, TP25
|
|
250
|
-
- **Wall Switches**: S500D, S505
|
|
250
|
+
- **Wall Switches**: S500D, S505, S505D
|
|
251
251
|
- **Bulbs**: L510B, L510E, L530E
|
|
252
252
|
- **Light Strips**: L900-10, L900-5, L920-5, L930-5
|
|
253
253
|
- **Hubs**: H100
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
# python-kasa
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/py/python-kasa)
|
|
4
4
|
[](https://github.com/python-kasa/python-kasa/actions/workflows/ci.yml)
|
|
@@ -207,9 +207,9 @@ The following devices have been tested and confirmed as working. If your device
|
|
|
207
207
|
|
|
208
208
|
### Supported Tapo<sup>\*</sup> devices
|
|
209
209
|
|
|
210
|
-
- **Plugs**: P100, P110, P125M, P135, TP15
|
|
210
|
+
- **Plugs**: P100, P110, P115, P125M, P135, TP15
|
|
211
211
|
- **Power Strips**: P300, TP25
|
|
212
|
-
- **Wall Switches**: S500D, S505
|
|
212
|
+
- **Wall Switches**: S500D, S505, S505D
|
|
213
213
|
- **Bulbs**: L510B, L510E, L530E
|
|
214
214
|
- **Light Strips**: L900-10, L900-5, L920-5, L930-5
|
|
215
215
|
- **Hubs**: H100
|
|
@@ -20,10 +20,10 @@ from kasa.credentials import Credentials
|
|
|
20
20
|
from kasa.device import Device
|
|
21
21
|
from kasa.device_type import DeviceType
|
|
22
22
|
from kasa.deviceconfig import (
|
|
23
|
-
ConnectionType,
|
|
24
23
|
DeviceConfig,
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
DeviceConnectionParameters,
|
|
25
|
+
DeviceEncryptionType,
|
|
26
|
+
DeviceFamily,
|
|
27
27
|
)
|
|
28
28
|
from kasa.discover import Discover
|
|
29
29
|
from kasa.emeterstatus import EmeterStatus
|
|
@@ -35,7 +35,7 @@ from kasa.exceptions import (
|
|
|
35
35
|
UnsupportedDeviceError,
|
|
36
36
|
)
|
|
37
37
|
from kasa.feature import Feature
|
|
38
|
-
from kasa.interfaces.light import Light, LightState
|
|
38
|
+
from kasa.interfaces.light import HSV, ColorTempRange, Light, LightState
|
|
39
39
|
from kasa.iotprotocol import (
|
|
40
40
|
IotProtocol,
|
|
41
41
|
_deprecated_TPLinkSmartHomeProtocol, # noqa: F401
|
|
@@ -60,6 +60,8 @@ __all__ = [
|
|
|
60
60
|
"EmeterStatus",
|
|
61
61
|
"Device",
|
|
62
62
|
"Light",
|
|
63
|
+
"ColorTempRange",
|
|
64
|
+
"HSV",
|
|
63
65
|
"Plug",
|
|
64
66
|
"Module",
|
|
65
67
|
"KasaException",
|
|
@@ -69,9 +71,9 @@ __all__ = [
|
|
|
69
71
|
"TimeoutError",
|
|
70
72
|
"Credentials",
|
|
71
73
|
"DeviceConfig",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
74
|
+
"DeviceConnectionParameters",
|
|
75
|
+
"DeviceEncryptionType",
|
|
76
|
+
"DeviceFamily",
|
|
75
77
|
]
|
|
76
78
|
|
|
77
79
|
from . import iot
|
|
@@ -87,11 +89,14 @@ deprecated_smart_devices = {
|
|
|
87
89
|
"SmartDimmer": iot.IotDimmer,
|
|
88
90
|
"SmartBulbPreset": IotLightPreset,
|
|
89
91
|
}
|
|
90
|
-
|
|
92
|
+
deprecated_classes = {
|
|
91
93
|
"SmartDeviceException": KasaException,
|
|
92
94
|
"UnsupportedDeviceException": UnsupportedDeviceError,
|
|
93
95
|
"AuthenticationException": AuthenticationError,
|
|
94
96
|
"TimeoutException": TimeoutError,
|
|
97
|
+
"ConnectionType": DeviceConnectionParameters,
|
|
98
|
+
"EncryptType": DeviceEncryptionType,
|
|
99
|
+
"DeviceFamilyType": DeviceFamily,
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
|
|
@@ -110,8 +115,8 @@ def __getattr__(name):
|
|
|
110
115
|
stacklevel=1,
|
|
111
116
|
)
|
|
112
117
|
return new_class
|
|
113
|
-
if name in
|
|
114
|
-
new_class =
|
|
118
|
+
if name in deprecated_classes:
|
|
119
|
+
new_class = deprecated_classes[name]
|
|
115
120
|
msg = f"{name} is deprecated, use {new_class.__name__} instead"
|
|
116
121
|
warn(msg, DeprecationWarning, stacklevel=1)
|
|
117
122
|
return new_class
|
|
@@ -131,6 +136,10 @@ if TYPE_CHECKING:
|
|
|
131
136
|
UnsupportedDeviceException = UnsupportedDeviceError
|
|
132
137
|
AuthenticationException = AuthenticationError
|
|
133
138
|
TimeoutException = TimeoutError
|
|
139
|
+
ConnectionType = DeviceConnectionParameters
|
|
140
|
+
EncryptType = DeviceEncryptionType
|
|
141
|
+
DeviceFamilyType = DeviceFamily
|
|
142
|
+
|
|
134
143
|
# Instanstiate all classes so the type checkers catch abstract issues
|
|
135
144
|
from . import smart
|
|
136
145
|
|
|
@@ -6,7 +6,6 @@ under compatible GNU GPL3 license.
|
|
|
6
6
|
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
|
-
import asyncio
|
|
10
9
|
import base64
|
|
11
10
|
import hashlib
|
|
12
11
|
import logging
|
|
@@ -74,7 +73,6 @@ class AesTransport(BaseTransport):
|
|
|
74
73
|
}
|
|
75
74
|
CONTENT_LENGTH = "Content-Length"
|
|
76
75
|
KEY_PAIR_CONTENT_LENGTH = 314
|
|
77
|
-
BACKOFF_SECONDS_AFTER_LOGIN_ERROR = 1
|
|
78
76
|
|
|
79
77
|
def __init__(
|
|
80
78
|
self,
|
|
@@ -216,7 +214,6 @@ class AesTransport(BaseTransport):
|
|
|
216
214
|
self._default_credentials = get_default_credentials(
|
|
217
215
|
DEFAULT_CREDENTIALS["TAPO"]
|
|
218
216
|
)
|
|
219
|
-
await asyncio.sleep(self.BACKOFF_SECONDS_AFTER_LOGIN_ERROR)
|
|
220
217
|
await self.perform_handshake()
|
|
221
218
|
await self.try_login(self._get_login_params(self._default_credentials))
|
|
222
219
|
_LOGGER.debug(
|
|
@@ -18,13 +18,13 @@ from pydantic.v1 import ValidationError
|
|
|
18
18
|
|
|
19
19
|
from kasa import (
|
|
20
20
|
AuthenticationError,
|
|
21
|
-
ConnectionType,
|
|
22
21
|
Credentials,
|
|
23
22
|
Device,
|
|
24
23
|
DeviceConfig,
|
|
25
|
-
|
|
24
|
+
DeviceConnectionParameters,
|
|
25
|
+
DeviceEncryptionType,
|
|
26
|
+
DeviceFamily,
|
|
26
27
|
Discover,
|
|
27
|
-
EncryptType,
|
|
28
28
|
Feature,
|
|
29
29
|
KasaException,
|
|
30
30
|
Module,
|
|
@@ -87,11 +87,9 @@ TYPE_TO_CLASS = {
|
|
|
87
87
|
"smart.bulb": SmartDevice,
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
ENCRYPT_TYPES = [encrypt_type.value for encrypt_type in
|
|
90
|
+
ENCRYPT_TYPES = [encrypt_type.value for encrypt_type in DeviceEncryptionType]
|
|
91
91
|
|
|
92
|
-
DEVICE_FAMILY_TYPES = [
|
|
93
|
-
device_family_type.value for device_family_type in DeviceFamilyType
|
|
94
|
-
]
|
|
92
|
+
DEVICE_FAMILY_TYPES = [device_family_type.value for device_family_type in DeviceFamily]
|
|
95
93
|
|
|
96
94
|
# Block list of commands which require no update
|
|
97
95
|
SKIP_UPDATE_COMMANDS = ["wifi", "raw-command", "command"]
|
|
@@ -111,6 +109,10 @@ def CatchAllExceptions(cls):
|
|
|
111
109
|
def _handle_exception(debug, exc):
|
|
112
110
|
if isinstance(exc, click.ClickException):
|
|
113
111
|
raise
|
|
112
|
+
# Handle exit request from click.
|
|
113
|
+
if isinstance(exc, click.exceptions.Exit):
|
|
114
|
+
sys.exit(exc.exit_code)
|
|
115
|
+
|
|
114
116
|
echo(f"Raised error: {exc}")
|
|
115
117
|
if debug:
|
|
116
118
|
raise
|
|
@@ -370,9 +372,9 @@ async def cli(
|
|
|
370
372
|
if type is not None:
|
|
371
373
|
dev = TYPE_TO_CLASS[type](host)
|
|
372
374
|
elif device_family and encrypt_type:
|
|
373
|
-
ctype =
|
|
374
|
-
|
|
375
|
-
|
|
375
|
+
ctype = DeviceConnectionParameters(
|
|
376
|
+
DeviceFamily(device_family),
|
|
377
|
+
DeviceEncryptionType(encrypt_type),
|
|
376
378
|
login_version,
|
|
377
379
|
)
|
|
378
380
|
config = DeviceConfig(
|
|
@@ -9,9 +9,16 @@ from datetime import datetime
|
|
|
9
9
|
from typing import TYPE_CHECKING, Any, Mapping, Sequence
|
|
10
10
|
from warnings import warn
|
|
11
11
|
|
|
12
|
-
from
|
|
12
|
+
from typing_extensions import TypeAlias
|
|
13
|
+
|
|
14
|
+
from .credentials import Credentials as _Credentials
|
|
13
15
|
from .device_type import DeviceType
|
|
14
|
-
from .deviceconfig import
|
|
16
|
+
from .deviceconfig import (
|
|
17
|
+
DeviceConfig,
|
|
18
|
+
DeviceConnectionParameters,
|
|
19
|
+
DeviceEncryptionType,
|
|
20
|
+
DeviceFamily,
|
|
21
|
+
)
|
|
15
22
|
from .emeterstatus import EmeterStatus
|
|
16
23
|
from .exceptions import KasaException
|
|
17
24
|
from .feature import Feature
|
|
@@ -51,6 +58,22 @@ class Device(ABC):
|
|
|
51
58
|
or :func:`Discover.discover_single()`.
|
|
52
59
|
"""
|
|
53
60
|
|
|
61
|
+
# All types required to create devices directly via connect are aliased here
|
|
62
|
+
# to avoid consumers having to do multiple imports.
|
|
63
|
+
|
|
64
|
+
#: The type of device
|
|
65
|
+
Type: TypeAlias = DeviceType
|
|
66
|
+
#: The credentials for authentication
|
|
67
|
+
Credentials: TypeAlias = _Credentials
|
|
68
|
+
#: Configuration for connecting to the device
|
|
69
|
+
Config: TypeAlias = DeviceConfig
|
|
70
|
+
#: The family of the device, e.g. SMART.KASASWITCH.
|
|
71
|
+
Family: TypeAlias = DeviceFamily
|
|
72
|
+
#: The encryption for the device, e.g. Klap or Aes
|
|
73
|
+
EncryptionType: TypeAlias = DeviceEncryptionType
|
|
74
|
+
#: The connection type for the device.
|
|
75
|
+
ConnectionParameters: TypeAlias = DeviceConnectionParameters
|
|
76
|
+
|
|
54
77
|
def __init__(
|
|
55
78
|
self,
|
|
56
79
|
host: str,
|
|
@@ -138,6 +161,14 @@ class Device(ABC):
|
|
|
138
161
|
async def turn_off(self, **kwargs) -> dict | None:
|
|
139
162
|
"""Turn off the device."""
|
|
140
163
|
|
|
164
|
+
@abstractmethod
|
|
165
|
+
async def set_state(self, on: bool):
|
|
166
|
+
"""Set the device state to *on*.
|
|
167
|
+
|
|
168
|
+
This allows turning the device on and off.
|
|
169
|
+
See also *turn_off* and *turn_on*.
|
|
170
|
+
"""
|
|
171
|
+
|
|
141
172
|
@property
|
|
142
173
|
def host(self) -> str:
|
|
143
174
|
"""The device host."""
|
|
@@ -158,7 +189,7 @@ class Device(ABC):
|
|
|
158
189
|
return self.protocol._transport._port
|
|
159
190
|
|
|
160
191
|
@property
|
|
161
|
-
def credentials(self) ->
|
|
192
|
+
def credentials(self) -> _Credentials | None:
|
|
162
193
|
"""The device credentials."""
|
|
163
194
|
return self.protocol._transport._credentials
|
|
164
195
|
|
|
@@ -1,10 +1,35 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Configuration for connecting directly to a device without discovery.
|
|
2
|
+
|
|
3
|
+
If you are connecting to a newer KASA or TAPO device you can get the device
|
|
4
|
+
via discovery or connect directly with :class:`DeviceConfig`.
|
|
5
|
+
|
|
6
|
+
Discovery returns a list of discovered devices:
|
|
7
|
+
|
|
8
|
+
>>> from kasa import Discover, Device
|
|
9
|
+
>>> device = await Discover.discover_single(
|
|
10
|
+
>>> "127.0.0.3",
|
|
11
|
+
>>> username="user@example.com",
|
|
12
|
+
>>> password="great_password",
|
|
13
|
+
>>> )
|
|
14
|
+
>>> print(device.alias) # Alias is None because update() has not been called
|
|
15
|
+
None
|
|
16
|
+
|
|
17
|
+
>>> config_dict = device.config.to_dict()
|
|
18
|
+
>>> # DeviceConfig.to_dict() can be used to store for later
|
|
19
|
+
>>> print(config_dict)
|
|
20
|
+
{'host': '127.0.0.3', 'timeout': 5, 'credentials': Credentials(), 'connection_type'\
|
|
21
|
+
: {'device_family': 'SMART.TAPOBULB', 'encryption_type': 'KLAP', 'login_version': 2},\
|
|
22
|
+
'uses_http': True}
|
|
23
|
+
|
|
24
|
+
>>> later_device = await Device.connect(config=Device.Config.from_dict(config_dict))
|
|
25
|
+
>>> print(later_device.alias) # Alias is available as connect() calls update()
|
|
26
|
+
Living Room Bulb
|
|
2
27
|
|
|
3
|
-
Note that this module does not work with from __future__ import annotations
|
|
4
|
-
due to it's use of type returned by fields() which becomes a string with the import.
|
|
5
|
-
https://bugs.python.org/issue39442
|
|
6
28
|
"""
|
|
7
29
|
|
|
30
|
+
# Note that this module does not work with from __future__ import annotations
|
|
31
|
+
# due to it's use of type returned by fields() which becomes a string with the import.
|
|
32
|
+
# https://bugs.python.org/issue39442
|
|
8
33
|
# ruff: noqa: FA100
|
|
9
34
|
import logging
|
|
10
35
|
from dataclasses import asdict, dataclass, field, fields, is_dataclass
|
|
@@ -20,7 +45,7 @@ if TYPE_CHECKING:
|
|
|
20
45
|
_LOGGER = logging.getLogger(__name__)
|
|
21
46
|
|
|
22
47
|
|
|
23
|
-
class
|
|
48
|
+
class DeviceEncryptionType(Enum):
|
|
24
49
|
"""Encrypt type enum."""
|
|
25
50
|
|
|
26
51
|
Klap = "KLAP"
|
|
@@ -28,7 +53,7 @@ class EncryptType(Enum):
|
|
|
28
53
|
Xor = "XOR"
|
|
29
54
|
|
|
30
55
|
|
|
31
|
-
class
|
|
56
|
+
class DeviceFamily(Enum):
|
|
32
57
|
"""Encrypt type enum."""
|
|
33
58
|
|
|
34
59
|
IotSmartPlugSwitch = "IOT.SMARTPLUGSWITCH"
|
|
@@ -80,11 +105,11 @@ def _dataclass_to_dict(in_val):
|
|
|
80
105
|
|
|
81
106
|
|
|
82
107
|
@dataclass
|
|
83
|
-
class
|
|
108
|
+
class DeviceConnectionParameters:
|
|
84
109
|
"""Class to hold the the parameters determining connection type."""
|
|
85
110
|
|
|
86
|
-
device_family:
|
|
87
|
-
encryption_type:
|
|
111
|
+
device_family: DeviceFamily
|
|
112
|
+
encryption_type: DeviceEncryptionType
|
|
88
113
|
login_version: Optional[int] = None
|
|
89
114
|
|
|
90
115
|
@staticmethod
|
|
@@ -92,12 +117,12 @@ class ConnectionType:
|
|
|
92
117
|
device_family: str,
|
|
93
118
|
encryption_type: str,
|
|
94
119
|
login_version: Optional[int] = None,
|
|
95
|
-
) -> "
|
|
120
|
+
) -> "DeviceConnectionParameters":
|
|
96
121
|
"""Return connection parameters from string values."""
|
|
97
122
|
try:
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
|
|
123
|
+
return DeviceConnectionParameters(
|
|
124
|
+
DeviceFamily(device_family),
|
|
125
|
+
DeviceEncryptionType(encryption_type),
|
|
101
126
|
login_version,
|
|
102
127
|
)
|
|
103
128
|
except (ValueError, TypeError) as ex:
|
|
@@ -107,7 +132,7 @@ class ConnectionType:
|
|
|
107
132
|
) from ex
|
|
108
133
|
|
|
109
134
|
@staticmethod
|
|
110
|
-
def from_dict(connection_type_dict: Dict[str, str]) -> "
|
|
135
|
+
def from_dict(connection_type_dict: Dict[str, str]) -> "DeviceConnectionParameters":
|
|
111
136
|
"""Return connection parameters from dict."""
|
|
112
137
|
if (
|
|
113
138
|
isinstance(connection_type_dict, dict)
|
|
@@ -116,7 +141,7 @@ class ConnectionType:
|
|
|
116
141
|
):
|
|
117
142
|
if login_version := connection_type_dict.get("login_version"):
|
|
118
143
|
login_version = int(login_version) # type: ignore[assignment]
|
|
119
|
-
return
|
|
144
|
+
return DeviceConnectionParameters.from_values(
|
|
120
145
|
device_family,
|
|
121
146
|
encryption_type,
|
|
122
147
|
login_version, # type: ignore[arg-type]
|
|
@@ -155,9 +180,9 @@ class DeviceConfig:
|
|
|
155
180
|
#: The protocol specific type of connection. Defaults to the legacy type.
|
|
156
181
|
batch_size: Optional[int] = None
|
|
157
182
|
#: The batch size for protoools supporting multiple request batches.
|
|
158
|
-
connection_type:
|
|
159
|
-
default_factory=lambda:
|
|
160
|
-
|
|
183
|
+
connection_type: DeviceConnectionParameters = field(
|
|
184
|
+
default_factory=lambda: DeviceConnectionParameters(
|
|
185
|
+
DeviceFamily.IotSmartPlugSwitch, DeviceEncryptionType.Xor, 1
|
|
161
186
|
)
|
|
162
187
|
)
|
|
163
188
|
#: True if the device uses http. Consumers should retrieve rather than set this
|
|
@@ -170,8 +195,8 @@ class DeviceConfig:
|
|
|
170
195
|
|
|
171
196
|
def __post_init__(self):
|
|
172
197
|
if self.connection_type is None:
|
|
173
|
-
self.connection_type =
|
|
174
|
-
|
|
198
|
+
self.connection_type = DeviceConnectionParameters(
|
|
199
|
+
DeviceFamily.IotSmartPlugSwitch, DeviceEncryptionType.Xor
|
|
175
200
|
)
|
|
176
201
|
|
|
177
202
|
def to_dict(
|
|
@@ -1,4 +1,83 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Discover TPLink Smart Home devices.
|
|
2
|
+
|
|
3
|
+
The main entry point for this library is :func:`Discover.discover()`,
|
|
4
|
+
which returns a dictionary of the found devices. The key is the IP address
|
|
5
|
+
of the device and the value contains ready-to-use, SmartDevice-derived
|
|
6
|
+
device object.
|
|
7
|
+
|
|
8
|
+
:func:`discover_single()` can be used to initialize a single device given its
|
|
9
|
+
IP address. If the :class:`DeviceConfig` of the device is already known,
|
|
10
|
+
you can initialize the corresponding device class directly without discovery.
|
|
11
|
+
|
|
12
|
+
The protocol uses UDP broadcast datagrams on port 9999 and 20002 for discovery.
|
|
13
|
+
Legacy devices support discovery on port 9999 and newer devices on 20002.
|
|
14
|
+
|
|
15
|
+
Newer devices that respond on port 20002 will most likely require TP-Link cloud
|
|
16
|
+
credentials to be passed if queries or updates are to be performed on the returned
|
|
17
|
+
devices.
|
|
18
|
+
|
|
19
|
+
Discovery returns a dict of {ip: discovered devices}:
|
|
20
|
+
|
|
21
|
+
>>> from kasa import Discover, Credentials
|
|
22
|
+
>>>
|
|
23
|
+
>>> found_devices = await Discover.discover()
|
|
24
|
+
>>> [dev.model for dev in found_devices.values()]
|
|
25
|
+
['KP303(UK)', 'HS110(EU)', 'L530E', 'KL430(US)', 'HS220(US)']
|
|
26
|
+
|
|
27
|
+
You can pass username and password for devices requiring authentication
|
|
28
|
+
|
|
29
|
+
>>> devices = await Discover.discover(
|
|
30
|
+
>>> username="user@example.com",
|
|
31
|
+
>>> password="great_password",
|
|
32
|
+
>>> )
|
|
33
|
+
>>> print(len(devices))
|
|
34
|
+
5
|
|
35
|
+
|
|
36
|
+
You can also pass a :class:`kasa.Credentials`
|
|
37
|
+
|
|
38
|
+
>>> creds = Credentials("user@example.com", "great_password")
|
|
39
|
+
>>> devices = await Discover.discover(credentials=creds)
|
|
40
|
+
>>> print(len(devices))
|
|
41
|
+
5
|
|
42
|
+
|
|
43
|
+
Discovery can also be targeted to a specific broadcast address instead of
|
|
44
|
+
the default 255.255.255.255:
|
|
45
|
+
|
|
46
|
+
>>> found_devices = await Discover.discover(target="127.0.0.255", credentials=creds)
|
|
47
|
+
>>> print(len(found_devices))
|
|
48
|
+
5
|
|
49
|
+
|
|
50
|
+
Basic information is available on the device from the discovery broadcast response
|
|
51
|
+
but it is important to call device.update() after discovery if you want to access
|
|
52
|
+
all the attributes without getting errors or None.
|
|
53
|
+
|
|
54
|
+
>>> dev = found_devices["127.0.0.3"]
|
|
55
|
+
>>> dev.alias
|
|
56
|
+
None
|
|
57
|
+
>>> await dev.update()
|
|
58
|
+
>>> dev.alias
|
|
59
|
+
'Living Room Bulb'
|
|
60
|
+
|
|
61
|
+
It is also possible to pass a coroutine to be executed for each found device:
|
|
62
|
+
|
|
63
|
+
>>> async def print_dev_info(dev):
|
|
64
|
+
>>> await dev.update()
|
|
65
|
+
>>> print(f"Discovered {dev.alias} (model: {dev.model})")
|
|
66
|
+
>>>
|
|
67
|
+
>>> devices = await Discover.discover(on_discovered=print_dev_info, credentials=creds)
|
|
68
|
+
Discovered Bedroom Power Strip (model: KP303(UK))
|
|
69
|
+
Discovered Bedroom Lamp Plug (model: HS110(EU))
|
|
70
|
+
Discovered Living Room Bulb (model: L530)
|
|
71
|
+
Discovered Bedroom Lightstrip (model: KL430(US))
|
|
72
|
+
Discovered Living Room Dimmer Switch (model: HS220(US))
|
|
73
|
+
|
|
74
|
+
Discovering a single device returns a kasa.Device object.
|
|
75
|
+
|
|
76
|
+
>>> device = await Discover.discover_single("127.0.0.1", credentials=creds)
|
|
77
|
+
>>> device.model
|
|
78
|
+
'KP303(UK)'
|
|
79
|
+
|
|
80
|
+
"""
|
|
2
81
|
|
|
3
82
|
from __future__ import annotations
|
|
4
83
|
|
|
@@ -21,7 +100,11 @@ from kasa.device_factory import (
|
|
|
21
100
|
get_device_class_from_sys_info,
|
|
22
101
|
get_protocol,
|
|
23
102
|
)
|
|
24
|
-
from kasa.deviceconfig import
|
|
103
|
+
from kasa.deviceconfig import (
|
|
104
|
+
DeviceConfig,
|
|
105
|
+
DeviceConnectionParameters,
|
|
106
|
+
DeviceEncryptionType,
|
|
107
|
+
)
|
|
25
108
|
from kasa.exceptions import (
|
|
26
109
|
KasaException,
|
|
27
110
|
TimeoutError,
|
|
@@ -198,45 +281,7 @@ class _DiscoverProtocol(asyncio.DatagramProtocol):
|
|
|
198
281
|
|
|
199
282
|
|
|
200
283
|
class Discover:
|
|
201
|
-
"""
|
|
202
|
-
|
|
203
|
-
The main entry point for this library is :func:`Discover.discover()`,
|
|
204
|
-
which returns a dictionary of the found devices. The key is the IP address
|
|
205
|
-
of the device and the value contains ready-to-use, SmartDevice-derived
|
|
206
|
-
device object.
|
|
207
|
-
|
|
208
|
-
:func:`discover_single()` can be used to initialize a single device given its
|
|
209
|
-
IP address. If the :class:`DeviceConfig` of the device is already known,
|
|
210
|
-
you can initialize the corresponding device class directly without discovery.
|
|
211
|
-
|
|
212
|
-
The protocol uses UDP broadcast datagrams on port 9999 and 20002 for discovery.
|
|
213
|
-
Legacy devices support discovery on port 9999 and newer devices on 20002.
|
|
214
|
-
|
|
215
|
-
Newer devices that respond on port 20002 will most likely require TP-Link cloud
|
|
216
|
-
credentials to be passed if queries or updates are to be performed on the returned
|
|
217
|
-
devices.
|
|
218
|
-
|
|
219
|
-
Examples:
|
|
220
|
-
Discovery returns a list of discovered devices:
|
|
221
|
-
|
|
222
|
-
>>> import asyncio
|
|
223
|
-
>>> found_devices = asyncio.run(Discover.discover())
|
|
224
|
-
>>> [dev.alias for dev in found_devices]
|
|
225
|
-
['TP-LINK_Power Strip_CF69']
|
|
226
|
-
|
|
227
|
-
Discovery can also be targeted to a specific broadcast address instead of
|
|
228
|
-
the default 255.255.255.255:
|
|
229
|
-
|
|
230
|
-
>>> asyncio.run(Discover.discover(target="192.168.8.255"))
|
|
231
|
-
|
|
232
|
-
It is also possible to pass a coroutine to be executed for each found device:
|
|
233
|
-
|
|
234
|
-
>>> async def print_alias(dev):
|
|
235
|
-
>>> print(f"Discovered {dev.alias}")
|
|
236
|
-
>>> devices = asyncio.run(Discover.discover(on_discovered=print_alias))
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
"""
|
|
284
|
+
"""Class for discovering devices."""
|
|
240
285
|
|
|
241
286
|
DISCOVERY_PORT = 9999
|
|
242
287
|
|
|
@@ -257,6 +302,8 @@ class Discover:
|
|
|
257
302
|
interface=None,
|
|
258
303
|
on_unsupported=None,
|
|
259
304
|
credentials=None,
|
|
305
|
+
username: str | None = None,
|
|
306
|
+
password: str | None = None,
|
|
260
307
|
port=None,
|
|
261
308
|
timeout=None,
|
|
262
309
|
) -> DeviceDict:
|
|
@@ -284,11 +331,16 @@ class Discover:
|
|
|
284
331
|
:param discovery_packets: Number of discovery packets to broadcast
|
|
285
332
|
:param interface: Bind to specific interface
|
|
286
333
|
:param on_unsupported: Optional callback when unsupported devices are discovered
|
|
287
|
-
:param credentials: Credentials for devices
|
|
334
|
+
:param credentials: Credentials for devices that require authentication.
|
|
335
|
+
username and password are ignored if provided.
|
|
336
|
+
:param username: Username for devices that require authentication
|
|
337
|
+
:param password: Password for devices that require authentication
|
|
288
338
|
:param port: Override the discovery port for devices listening on 9999
|
|
289
339
|
:param timeout: Query timeout in seconds for devices returned by discovery
|
|
290
340
|
:return: dictionary with discovered devices
|
|
291
341
|
"""
|
|
342
|
+
if not credentials and username and password:
|
|
343
|
+
credentials = Credentials(username, password)
|
|
292
344
|
loop = asyncio.get_event_loop()
|
|
293
345
|
transport, protocol = await loop.create_datagram_endpoint(
|
|
294
346
|
lambda: _DiscoverProtocol(
|
|
@@ -328,6 +380,8 @@ class Discover:
|
|
|
328
380
|
port: int | None = None,
|
|
329
381
|
timeout: int | None = None,
|
|
330
382
|
credentials: Credentials | None = None,
|
|
383
|
+
username: str | None = None,
|
|
384
|
+
password: str | None = None,
|
|
331
385
|
) -> Device:
|
|
332
386
|
"""Discover a single device by the given IP address.
|
|
333
387
|
|
|
@@ -340,10 +394,15 @@ class Discover:
|
|
|
340
394
|
:param discovery_timeout: Timeout in seconds for discovery
|
|
341
395
|
:param port: Optionally set a different port for legacy devices using port 9999
|
|
342
396
|
:param timeout: Timeout in seconds device for devices queries
|
|
343
|
-
:param credentials: Credentials for devices that require authentication
|
|
397
|
+
:param credentials: Credentials for devices that require authentication.
|
|
398
|
+
username and password are ignored if provided.
|
|
399
|
+
:param username: Username for devices that require authentication
|
|
400
|
+
:param password: Password for devices that require authentication
|
|
344
401
|
:rtype: SmartDevice
|
|
345
402
|
:return: Object for querying/controlling found device.
|
|
346
403
|
"""
|
|
404
|
+
if not credentials and username and password:
|
|
405
|
+
credentials = Credentials(username, password)
|
|
347
406
|
loop = asyncio.get_event_loop()
|
|
348
407
|
|
|
349
408
|
try:
|
|
@@ -430,8 +489,9 @@ class Discover:
|
|
|
430
489
|
device = device_class(config.host, config=config)
|
|
431
490
|
sys_info = info["system"]["get_sysinfo"]
|
|
432
491
|
if device_type := sys_info.get("mic_type", sys_info.get("type")):
|
|
433
|
-
config.connection_type =
|
|
434
|
-
device_family=device_type,
|
|
492
|
+
config.connection_type = DeviceConnectionParameters.from_values(
|
|
493
|
+
device_family=device_type,
|
|
494
|
+
encryption_type=DeviceEncryptionType.Xor.value,
|
|
435
495
|
)
|
|
436
496
|
device.protocol = get_protocol(config) # type: ignore[assignment]
|
|
437
497
|
device.update_from_discover_info(info)
|
|
@@ -463,7 +523,7 @@ class Discover:
|
|
|
463
523
|
type_ = discovery_result.device_type
|
|
464
524
|
|
|
465
525
|
try:
|
|
466
|
-
config.connection_type =
|
|
526
|
+
config.connection_type = DeviceConnectionParameters.from_values(
|
|
467
527
|
type_,
|
|
468
528
|
discovery_result.mgt_encrypt_schm.encrypt_type,
|
|
469
529
|
discovery_result.mgt_encrypt_schm.lv,
|