python-kasa 0.7.0.dev3__tar.gz → 0.7.0.dev4__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.dev3 → python_kasa-0.7.0.dev4}/CHANGELOG.md +15 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/PKG-INFO +1 -1
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/autooff.py +8 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/lightpreset.py +10 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/smartchilddevice.py +12 -1
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/smartdevice.py +16 -29
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/device_fixtures.py +31 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fakeprotocol_smart.py +19 -1
- python_kasa-0.7.0.dev4/kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.15.json +966 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/features/test_brightness.py +3 -3
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/modules/test_autooff.py +8 -8
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/modules/test_fan.py +6 -7
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_childdevice.py +19 -1
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_common_modules.py +8 -7
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_smartdevice.py +11 -7
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/pyproject.toml +1 -1
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/LICENSE +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/README.md +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/__init__.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/aestransport.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/cli.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/credentials.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/device.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/device_factory.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/device_type.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/deviceconfig.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/discover.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/emeterstatus.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/exceptions.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/feature.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/httpclient.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/interfaces/__init__.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/interfaces/fan.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/interfaces/led.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/interfaces/light.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/interfaces/lighteffect.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/interfaces/lightpreset.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/__init__.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/effects.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/iotbulb.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/iotdevice.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/iotdimmer.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/iotlightstrip.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/iotmodule.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/iotplug.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/iotstrip.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/__init__.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/ambientlight.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/antitheft.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/cloud.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/countdown.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/emeter.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/led.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/light.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/lighteffect.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/lightpreset.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/motion.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/rulemodule.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/schedule.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/time.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iot/modules/usage.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/iotprotocol.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/json.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/klaptransport.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/module.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/modulemapping.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/modulemapping.pyi +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/protocol.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/py.typed +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/__init__.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/effects.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/__init__.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/alarm.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/batterysensor.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/brightness.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/childdevice.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/cloud.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/color.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/colortemperature.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/contactsensor.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/devicemodule.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/energy.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/fan.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/firmware.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/frostprotection.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/humiditysensor.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/led.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/light.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/lighteffect.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/lightstripeffect.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/lighttransition.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/reportmode.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/temperaturecontrol.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/temperaturesensor.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/time.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/modules/waterleaksensor.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smart/smartmodule.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/smartprotocol.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/__init__.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/conftest.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/discovery_fixtures.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fakeprotocol_iot.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtureinfo.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/EP10(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/EP40(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/ES20M(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS100(UK)_1.0_1.2.6.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS100(UK)_4.1_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS100(US)_1.0_1.2.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS100(US)_2.0_1.5.6.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS103(US)_1.0_1.5.7.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS103(US)_2.1_1.1.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS103(US)_2.1_1.1.4.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS105(US)_1.0_1.5.6.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS107(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS110(EU)_1.0_1.2.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS110(EU)_4.0_1.0.4.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS110(US)_1.0_1.2.6.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS200(US)_2.0_1.5.7.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS200(US)_5.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS210(US)_1.0_1.5.8.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS220(US)_1.0_1.5.7.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS220(US)_2.0_1.0.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS300(US)_1.0_1.0.10.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS300(US)_1.0_1.0.21.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS300(US)_2.0_1.0.12.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/HS300(US)_2.0_1.0.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL110(US)_1.0_1.8.11.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL120(US)_1.0_1.8.11.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL120(US)_1.0_1.8.6.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL125(US)_1.20_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL125(US)_2.0_1.0.7.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL125(US)_4.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL130(EU)_1.0_1.8.8.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL130(US)_1.0_1.8.11.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL135(US)_1.0_1.0.6.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL400L5(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL400L5(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL420L5(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL430(UN)_2.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL430(US)_1.0_1.0.10.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL430(US)_2.0_1.0.11.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL430(US)_2.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL430(US)_2.0_1.0.9.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL50(US)_1.0_1.1.13.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL60(UN)_1.0_1.1.4.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KL60(US)_1.0_1.1.13.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP100(US)_3.0_1.0.1.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP105(UK)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP105(UK)_1.0_1.0.7.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP115(EU)_1.0_1.0.16.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP115(US)_1.0_1.0.17.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP115(US)_1.0_1.0.21.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP125(US)_1.0_1.0.6.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP200(US)_3.0_1.0.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP303(UK)_1.0_1.0.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP303(US)_2.0_1.0.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP400(US)_1.0_1.0.10.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP400(US)_2.0_1.0.6.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP401(US)_1.0_1.0.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KP405(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KS200M(US)_1.0_1.0.8.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KS220M(US)_1.0_1.0.4.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/KS230(US)_1.0_1.0.14.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/LB110(US)_1.0_1.8.11.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.1.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.2.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.10.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/KH100(UK)_1.0_1.5.6.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/KP125M(US)_1.0_1.1.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/KS205(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/KS225(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/KS240(US)_1.0_1.0.4.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/KS240(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L510B(EU)_3.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L510E(US)_3.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L510E(US)_3.0_1.1.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.0.6.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.1.6.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L530E(US)_2.0_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L900-10(EU)_1.0_1.0.17.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L900-10(US)_1.0_1.0.11.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L900-5(EU)_1.0_1.0.17.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L900-5(EU)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L920-5(US)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L920-5(US)_1.0_1.1.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/L930-5(US)_1.0_1.1.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/P100_1.0.0_1.1.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/P100_1.0.0_1.3.7.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/P100_1.0.0_1.4.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/P110(EU)_1.0_1.0.7.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/P110(EU)_1.0_1.2.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/P110(UK)_1.0_1.3.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/P115(EU)_1.0_1.2.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/P125M(US)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/P135(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.13.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.7.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/S500D(US)_1.0_1.0.5.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/S505(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/S505D(US)_1.0_1.1.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/TP15(US)_1.0_1.0.3.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/TP25(US)_1.0_1.0.2.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/child/KE100(EU)_1.0_2.4.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/child/KE100(EU)_1.0_2.8.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/child/KE100(UK)_1.0_2.8.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/child/T110(EU)_1.0_1.8.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/child/T300(EU)_1.0_1.7.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/child/T310(EU)_1.0_1.5.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/fixtures/smart/child/T315(EU)_1.0_1.7.0.json +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/__init__.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/features/__init__.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/features/test_colortemp.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/modules/__init__.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/modules/test_contact.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/modules/test_firmware.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/modules/test_humidity.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/modules/test_light_effect.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/modules/test_temperature.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/modules/test_temperaturecontrol.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/smart/modules/test_waterleak.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_aestransport.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_bulb.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_cli.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_device.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_device_factory.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_device_type.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_deviceconfig.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_dimmer.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_discovery.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_emeter.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_feature.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_httpclient.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_iotdevice.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_klapprotocol.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_lightstrip.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_plug.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_protocol.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_readme_examples.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_smartprotocol.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_strip.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/tests/test_usage.py +0 -0
- {python_kasa-0.7.0.dev3 → python_kasa-0.7.0.dev4}/kasa/xortransport.py +0 -0
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.0.dev4](https://github.com/python-kasa/python-kasa/tree/0.7.0.dev4) (2024-06-10)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/python-kasa/python-kasa/compare/0.7.0.dev3...0.7.0.dev4)
|
|
6
|
+
|
|
7
|
+
**Implemented enhancements:**
|
|
8
|
+
|
|
9
|
+
- Support smart child modules queries [\#967](https://github.com/python-kasa/python-kasa/pull/967) (@sdb9696)
|
|
10
|
+
- Do not expose child modules on parent devices [\#964](https://github.com/python-kasa/python-kasa/pull/964) (@sdb9696)
|
|
11
|
+
- Do not add parent only modules to strip sockets [\#963](https://github.com/python-kasa/python-kasa/pull/963) (@sdb9696)
|
|
12
|
+
|
|
13
|
+
**Project maintenance:**
|
|
14
|
+
|
|
15
|
+
- Better checking of child modules not supported by parent device [\#966](https://github.com/python-kasa/python-kasa/pull/966) (@sdb9696)
|
|
16
|
+
- Add fixture for p300 1.0.15 [\#915](https://github.com/python-kasa/python-kasa/pull/915) (@rytilahti)
|
|
17
|
+
|
|
3
18
|
## [0.7.0.dev3](https://github.com/python-kasa/python-kasa/tree/0.7.0.dev3) (2024-06-07)
|
|
4
19
|
|
|
5
20
|
[Full Changelog](https://github.com/python-kasa/python-kasa/compare/0.7.0.dev2...0.7.0.dev3)
|
|
@@ -99,3 +99,11 @@ class AutoOff(SmartModule):
|
|
|
99
99
|
sysinfo = self._device.sys_info
|
|
100
100
|
|
|
101
101
|
return self._device.time + timedelta(seconds=sysinfo["auto_off_remain_time"])
|
|
102
|
+
|
|
103
|
+
async def _check_supported(self):
|
|
104
|
+
"""Additional check to see if the module is supported by the device.
|
|
105
|
+
|
|
106
|
+
Parent devices that report components of children such as P300 will not have
|
|
107
|
+
the auto_off_status is sysinfo.
|
|
108
|
+
"""
|
|
109
|
+
return "auto_off_status" in self._device.sys_info
|
|
@@ -140,3 +140,13 @@ class LightPreset(SmartModule, LightPresetInterface):
|
|
|
140
140
|
if self._state_in_sysinfo: # Child lights can have states in the child info
|
|
141
141
|
return {}
|
|
142
142
|
return {self.QUERY_GETTER_NAME: None}
|
|
143
|
+
|
|
144
|
+
async def _check_supported(self):
|
|
145
|
+
"""Additional check to see if the module is supported by the device.
|
|
146
|
+
|
|
147
|
+
Parent devices that report components of children such as ks240 will not have
|
|
148
|
+
the brightness value is sysinfo.
|
|
149
|
+
"""
|
|
150
|
+
# Look in _device.sys_info here because self.data is either sys_info or
|
|
151
|
+
# get_preset_rules depending on whether it's a child device or not.
|
|
152
|
+
return "brightness" in self._device.sys_info
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import logging
|
|
6
|
+
from typing import Any
|
|
6
7
|
|
|
7
8
|
from ..device_type import DeviceType
|
|
8
9
|
from ..deviceconfig import DeviceConfig
|
|
@@ -34,7 +35,17 @@ class SmartChildDevice(SmartDevice):
|
|
|
34
35
|
self.protocol = _ChildProtocolWrapper(self._id, parent.protocol)
|
|
35
36
|
|
|
36
37
|
async def update(self, update_children: bool = True):
|
|
37
|
-
"""
|
|
38
|
+
"""Update child module info.
|
|
39
|
+
|
|
40
|
+
The parent updates our internal info so just update modules with
|
|
41
|
+
their own queries.
|
|
42
|
+
"""
|
|
43
|
+
req: dict[str, Any] = {}
|
|
44
|
+
for module in self.modules.values():
|
|
45
|
+
if mod_query := module.query():
|
|
46
|
+
req.update(mod_query)
|
|
47
|
+
if req:
|
|
48
|
+
self._last_update = await self.protocol.query(req)
|
|
38
49
|
|
|
39
50
|
@classmethod
|
|
40
51
|
async def create(cls, parent: SmartDevice, child_info, child_components):
|
|
@@ -29,11 +29,11 @@ from .smartmodule import SmartModule
|
|
|
29
29
|
_LOGGER = logging.getLogger(__name__)
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
# List of modules that
|
|
32
|
+
# List of modules that non hub devices with children, i.e. ks240/P300, report on
|
|
33
33
|
# the child but only work on the parent. See longer note below in _initialize_modules.
|
|
34
34
|
# This list should be updated when creating new modules that could have the
|
|
35
35
|
# same issue, homekit perhaps?
|
|
36
|
-
|
|
36
|
+
NON_HUB_PARENT_ONLY_MODULES = [DeviceModule, Time, Firmware, Cloud]
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
# Device must go last as the other interfaces also inherit Device
|
|
@@ -57,7 +57,6 @@ class SmartDevice(Device):
|
|
|
57
57
|
self._components: dict[str, int] = {}
|
|
58
58
|
self._state_information: dict[str, Any] = {}
|
|
59
59
|
self._modules: dict[str | ModuleName[Module], SmartModule] = {}
|
|
60
|
-
self._exposes_child_modules = False
|
|
61
60
|
self._parent: SmartDevice | None = None
|
|
62
61
|
self._children: Mapping[str, SmartDevice] = {}
|
|
63
62
|
self._last_update = {}
|
|
@@ -99,16 +98,6 @@ class SmartDevice(Device):
|
|
|
99
98
|
@property
|
|
100
99
|
def modules(self) -> ModuleMapping[SmartModule]:
|
|
101
100
|
"""Return the device modules."""
|
|
102
|
-
if self._exposes_child_modules:
|
|
103
|
-
modules = {k: v for k, v in self._modules.items()}
|
|
104
|
-
for child in self._children.values():
|
|
105
|
-
for k, v in child._modules.items():
|
|
106
|
-
if k not in modules:
|
|
107
|
-
modules[k] = v
|
|
108
|
-
if TYPE_CHECKING:
|
|
109
|
-
return cast(ModuleMapping[SmartModule], modules)
|
|
110
|
-
return modules
|
|
111
|
-
|
|
112
101
|
if TYPE_CHECKING: # Needed for python 3.8
|
|
113
102
|
return cast(ModuleMapping[SmartModule], self._modules)
|
|
114
103
|
return self._modules
|
|
@@ -160,7 +149,7 @@ class SmartDevice(Device):
|
|
|
160
149
|
if "child_device" in self._components and not self.children:
|
|
161
150
|
await self._initialize_children()
|
|
162
151
|
|
|
163
|
-
async def update(self, update_children: bool =
|
|
152
|
+
async def update(self, update_children: bool = False):
|
|
164
153
|
"""Update the device."""
|
|
165
154
|
if self.credentials is None and self.credentials_hash is None:
|
|
166
155
|
raise AuthenticationError("Tapo plug requires authentication.")
|
|
@@ -178,9 +167,14 @@ class SmartDevice(Device):
|
|
|
178
167
|
self._last_update = resp = await self.protocol.query(req)
|
|
179
168
|
|
|
180
169
|
self._info = self._try_get_response(resp, "get_device_info")
|
|
170
|
+
|
|
171
|
+
# Call child update which will only update module calls, info is updated
|
|
172
|
+
# from get_child_device_list. update_children only affects hub devices, other
|
|
173
|
+
# devices will always update children to prevent errors on module access.
|
|
174
|
+
if update_children or self.device_type != DeviceType.Hub:
|
|
175
|
+
for child in self._children.values():
|
|
176
|
+
await child.update()
|
|
181
177
|
if child_info := self._try_get_response(resp, "get_child_device_list", {}):
|
|
182
|
-
# TODO: we don't currently perform queries on children based on modules,
|
|
183
|
-
# but just update the information that is returned in the main query.
|
|
184
178
|
for info in child_info["child_device_list"]:
|
|
185
179
|
self._children[info["device_id"]]._update_internal_state(info)
|
|
186
180
|
|
|
@@ -207,21 +201,18 @@ class SmartDevice(Device):
|
|
|
207
201
|
# when they need to be accessed through the children.
|
|
208
202
|
# The logic below ensures that such devices add all but whitelisted, only on
|
|
209
203
|
# the child device.
|
|
204
|
+
# It also ensures that devices like power strips do not add modules such as
|
|
205
|
+
# firmware to the child devices.
|
|
210
206
|
skip_parent_only_modules = False
|
|
211
207
|
child_modules_to_skip = {}
|
|
212
|
-
if self._parent and self._parent.device_type
|
|
208
|
+
if self._parent and self._parent.device_type != DeviceType.Hub:
|
|
213
209
|
skip_parent_only_modules = True
|
|
214
|
-
elif self._children and self.device_type == DeviceType.WallSwitch:
|
|
215
|
-
# _initialize_modules is called on the parent after the children
|
|
216
|
-
self._exposes_child_modules = True
|
|
217
|
-
for child in self._children.values():
|
|
218
|
-
child_modules_to_skip.update(**child.modules)
|
|
219
210
|
|
|
220
211
|
for mod in SmartModule.REGISTERED_MODULES.values():
|
|
221
212
|
_LOGGER.debug("%s requires %s", mod, mod.REQUIRED_COMPONENT)
|
|
222
213
|
|
|
223
214
|
if (
|
|
224
|
-
skip_parent_only_modules and mod in
|
|
215
|
+
skip_parent_only_modules and mod in NON_HUB_PARENT_ONLY_MODULES
|
|
225
216
|
) or mod.__name__ in child_modules_to_skip:
|
|
226
217
|
continue
|
|
227
218
|
if (
|
|
@@ -332,10 +323,7 @@ class SmartDevice(Device):
|
|
|
332
323
|
)
|
|
333
324
|
|
|
334
325
|
for module in self.modules.values():
|
|
335
|
-
|
|
336
|
-
# i.e. when _exposes_child_modules is true
|
|
337
|
-
if not module._module_features:
|
|
338
|
-
module._initialize_features()
|
|
326
|
+
module._initialize_features()
|
|
339
327
|
for feat in module._module_features.values():
|
|
340
328
|
self._add_feature(feat)
|
|
341
329
|
for child in self._children.values():
|
|
@@ -369,8 +357,7 @@ class SmartDevice(Device):
|
|
|
369
357
|
@property
|
|
370
358
|
def time(self) -> datetime:
|
|
371
359
|
"""Return the time."""
|
|
372
|
-
|
|
373
|
-
if self._parent and Module.Time in self.modules:
|
|
360
|
+
if self._parent and Module.Time in self._parent.modules:
|
|
374
361
|
_timemod = self._parent.modules[Module.Time]
|
|
375
362
|
else:
|
|
376
363
|
_timemod = self.modules[Module.Time]
|
|
@@ -152,6 +152,24 @@ def parametrize_combine(parametrized: list[pytest.MarkDecorator]):
|
|
|
152
152
|
)
|
|
153
153
|
|
|
154
154
|
|
|
155
|
+
def parametrize_subtract(params: pytest.MarkDecorator, subtract: pytest.MarkDecorator):
|
|
156
|
+
"""Combine multiple pytest parametrize dev marks into one set of fixtures."""
|
|
157
|
+
if params.args[0] != "dev" or subtract.args[0] != "dev":
|
|
158
|
+
raise Exception(
|
|
159
|
+
f"Supplied mark is not for dev fixture: {params.args[0]} {subtract.args[0]}"
|
|
160
|
+
)
|
|
161
|
+
fixtures = []
|
|
162
|
+
for param in params.args[1]:
|
|
163
|
+
if param not in subtract.args[1]:
|
|
164
|
+
fixtures.append(param)
|
|
165
|
+
return pytest.mark.parametrize(
|
|
166
|
+
"dev",
|
|
167
|
+
sorted(fixtures),
|
|
168
|
+
indirect=True,
|
|
169
|
+
ids=idgenerator,
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
|
|
155
173
|
def parametrize(
|
|
156
174
|
desc,
|
|
157
175
|
*,
|
|
@@ -434,3 +452,16 @@ async def dev(request) -> AsyncGenerator[Device, None]:
|
|
|
434
452
|
yield dev
|
|
435
453
|
|
|
436
454
|
await dev.disconnect()
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
def get_parent_and_child_modules(device: Device, module_name):
|
|
458
|
+
"""Return iterator of module if exists on parent and children.
|
|
459
|
+
|
|
460
|
+
Useful for testing devices that have components listed on the parent that are only
|
|
461
|
+
supported on the children, i.e. ks240.
|
|
462
|
+
"""
|
|
463
|
+
if module_name in device.modules:
|
|
464
|
+
yield device.modules[module_name]
|
|
465
|
+
for child in device.children:
|
|
466
|
+
if module_name in child.modules:
|
|
467
|
+
yield child.modules[module_name]
|
|
@@ -149,6 +149,11 @@ class FakeSmartTransport(BaseTransport):
|
|
|
149
149
|
if child["device_id"] == device_id:
|
|
150
150
|
info = child
|
|
151
151
|
break
|
|
152
|
+
# Create the child_devices fixture section for fixtures generated before it was added
|
|
153
|
+
if "child_devices" not in self.info:
|
|
154
|
+
self.info["child_devices"] = {}
|
|
155
|
+
# Get the method calls made directly on the child devices
|
|
156
|
+
child_device_calls = self.info["child_devices"].setdefault(device_id, {})
|
|
152
157
|
|
|
153
158
|
# We only support get & set device info for now.
|
|
154
159
|
if child_method == "get_device_info":
|
|
@@ -159,14 +164,27 @@ class FakeSmartTransport(BaseTransport):
|
|
|
159
164
|
return {"error_code": 0}
|
|
160
165
|
elif child_method == "set_preset_rules":
|
|
161
166
|
return self._set_child_preset_rules(info, child_params)
|
|
167
|
+
elif child_method in child_device_calls:
|
|
168
|
+
result = copy.deepcopy(child_device_calls[child_method])
|
|
169
|
+
return {"result": result, "error_code": 0}
|
|
162
170
|
elif (
|
|
163
171
|
# FIXTURE_MISSING is for service calls not in place when
|
|
164
172
|
# SMART fixtures started to be generated
|
|
165
173
|
missing_result := self.FIXTURE_MISSING_MAP.get(child_method)
|
|
166
174
|
) and missing_result[0] in self.components:
|
|
167
|
-
|
|
175
|
+
# Copy to info so it will work with update methods
|
|
176
|
+
child_device_calls[child_method] = copy.deepcopy(missing_result[1])
|
|
177
|
+
result = copy.deepcopy(info[child_method])
|
|
168
178
|
retval = {"result": result, "error_code": 0}
|
|
169
179
|
return retval
|
|
180
|
+
elif child_method[:4] == "set_":
|
|
181
|
+
target_method = f"get_{child_method[4:]}"
|
|
182
|
+
if target_method not in child_device_calls:
|
|
183
|
+
raise RuntimeError(
|
|
184
|
+
f"No {target_method} in child info, calling set before get not supported."
|
|
185
|
+
)
|
|
186
|
+
child_device_calls[target_method].update(child_params)
|
|
187
|
+
return {"error_code": 0}
|
|
170
188
|
else:
|
|
171
189
|
# PARAMS error returned for KS240 when get_device_usage called
|
|
172
190
|
# on parent device. Could be any error code though.
|