python-kasa 0.7.3__py3-none-any.whl → 0.7.4__py3-none-any.whl
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.
- kasa/cli/device.py +12 -1
- kasa/device.py +15 -0
- kasa/iot/iotbulb.py +1 -1
- kasa/iot/iotdevice.py +7 -0
- {python_kasa-0.7.3.dist-info → python_kasa-0.7.4.dist-info}/METADATA +1 -1
- {python_kasa-0.7.3.dist-info → python_kasa-0.7.4.dist-info}/RECORD +9 -9
- {python_kasa-0.7.3.dist-info → python_kasa-0.7.4.dist-info}/WHEEL +0 -0
- {python_kasa-0.7.3.dist-info → python_kasa-0.7.4.dist-info}/entry_points.txt +0 -0
- {python_kasa-0.7.3.dist-info → python_kasa-0.7.4.dist-info}/licenses/LICENSE +0 -0
kasa/cli/device.py
CHANGED
|
@@ -99,7 +99,7 @@ async def on(dev: Device, transition: int):
|
|
|
99
99
|
return await dev.turn_on(transition=transition)
|
|
100
100
|
|
|
101
101
|
|
|
102
|
-
@
|
|
102
|
+
@device.command
|
|
103
103
|
@click.option("--transition", type=int, required=False)
|
|
104
104
|
@pass_dev_or_child
|
|
105
105
|
async def off(dev: Device, transition: int):
|
|
@@ -166,6 +166,17 @@ async def reboot(plug, delay):
|
|
|
166
166
|
return await plug.reboot(delay)
|
|
167
167
|
|
|
168
168
|
|
|
169
|
+
@device.command()
|
|
170
|
+
@pass_dev
|
|
171
|
+
async def factory_reset(plug):
|
|
172
|
+
"""Reset device to factory settings."""
|
|
173
|
+
click.confirm(
|
|
174
|
+
"Do you really want to reset the device to factory settings?", abort=True
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
return await plug.factory_reset()
|
|
178
|
+
|
|
179
|
+
|
|
169
180
|
@device.command()
|
|
170
181
|
@pass_dev
|
|
171
182
|
@click.option(
|
kasa/device.py
CHANGED
|
@@ -449,6 +449,21 @@ class Device(ABC):
|
|
|
449
449
|
async def set_alias(self, alias: str):
|
|
450
450
|
"""Set the device name (alias)."""
|
|
451
451
|
|
|
452
|
+
@abstractmethod
|
|
453
|
+
async def reboot(self, delay: int = 1) -> None:
|
|
454
|
+
"""Reboot the device.
|
|
455
|
+
|
|
456
|
+
Note that giving a delay of zero causes this to block,
|
|
457
|
+
as the device reboots immediately without responding to the call.
|
|
458
|
+
"""
|
|
459
|
+
|
|
460
|
+
@abstractmethod
|
|
461
|
+
async def factory_reset(self) -> None:
|
|
462
|
+
"""Reset device back to factory settings.
|
|
463
|
+
|
|
464
|
+
Note, this does not downgrade the firmware.
|
|
465
|
+
"""
|
|
466
|
+
|
|
452
467
|
def __repr__(self):
|
|
453
468
|
if self._last_update is None:
|
|
454
469
|
return f"<{self.device_type} at {self.host} - update() needed>"
|
kasa/iot/iotbulb.py
CHANGED
|
@@ -85,7 +85,7 @@ TPLINK_KELVIN = {
|
|
|
85
85
|
"KB130": ColorTempRange(2500, 9000),
|
|
86
86
|
"KL130": ColorTempRange(2500, 9000),
|
|
87
87
|
"KL125": ColorTempRange(2500, 6500),
|
|
88
|
-
"KL135": ColorTempRange(2500,
|
|
88
|
+
"KL135": ColorTempRange(2500, 9000),
|
|
89
89
|
r"KL120\(EU\)": ColorTempRange(2700, 6500),
|
|
90
90
|
r"KL120\(US\)": ColorTempRange(2700, 5000),
|
|
91
91
|
r"KL430": ColorTempRange(2500, 9000),
|
kasa/iot/iotdevice.py
CHANGED
|
@@ -561,6 +561,13 @@ class IotDevice(Device):
|
|
|
561
561
|
"""
|
|
562
562
|
await self._query_helper("system", "reboot", {"delay": delay})
|
|
563
563
|
|
|
564
|
+
async def factory_reset(self) -> None:
|
|
565
|
+
"""Reset device back to factory settings.
|
|
566
|
+
|
|
567
|
+
Note, this does not downgrade the firmware.
|
|
568
|
+
"""
|
|
569
|
+
await self._query_helper("system", "reset")
|
|
570
|
+
|
|
564
571
|
async def turn_off(self, **kwargs) -> dict:
|
|
565
572
|
"""Turn off the device."""
|
|
566
573
|
raise NotImplementedError("Device subclass needs to implement this.")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: python-kasa
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.4
|
|
4
4
|
Summary: Python API for TP-Link Kasa and Tapo devices
|
|
5
5
|
Project-URL: Homepage, https://github.com/python-kasa/python-kasa
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/python-kasa/python-kasa/issues
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
kasa/__init__.py,sha256=Hxo9ItTa2noIYRXWVSneK15nDUWdd3fBUcYYJTlC2bM,4454
|
|
2
2
|
kasa/aestransport.py,sha256=Cin2Zz_XUi5N9r8YLmqchkYnLU6ZHHIAg4tIQjPO43A,17128
|
|
3
3
|
kasa/credentials.py,sha256=SU9O5QjkWsozC7oCMhc2abydmETNjLZrJwv_KJ6fnK4,357
|
|
4
|
-
kasa/device.py,sha256=
|
|
4
|
+
kasa/device.py,sha256=r2Zr18nVDDaLlV6x5lhfqakG_EFUSMPsWZ068BCjiwg,17862
|
|
5
5
|
kasa/device_factory.py,sha256=2o9galcsQOajt8H4zdii1Ads4lgdhQQHAQlwCy-LsIk,7043
|
|
6
6
|
kasa/device_type.py,sha256=MJW1bVoAcH_MILSW8IBpv3jKRbPWkxmvuWdU-7Ov_D0,744
|
|
7
7
|
kasa/deviceconfig.py,sha256=pqAxoA41pIG9Q0E3jdlQKsbPd1Qvc8AScULjaZXxInc,8196
|
|
@@ -23,7 +23,7 @@ kasa/xortransport.py,sha256=sXZ6AhCsvmahSIszzDEuv2KXUoPAYBTLQ60e43cSg7k,8428
|
|
|
23
23
|
kasa/cli/__init__.py,sha256=S8z6xs4EPXXtF2wLwuvDLjcuy46c0jWaG0wiqqU5FiY,27
|
|
24
24
|
kasa/cli/__main__.py,sha256=B5nsKIZhYL1upQHrrKXnqE3t261v8nthD52e8m3DAgY,88
|
|
25
25
|
kasa/cli/common.py,sha256=ETCuAaPyxJaGQXgpVDjt-9g7kIJZjtk-YXLdw9yjFB0,7360
|
|
26
|
-
kasa/cli/device.py,sha256=
|
|
26
|
+
kasa/cli/device.py,sha256=PLCi3Cwyy6soneJTli_bakz3kI2It4KAg2MA5LViyFQ,5291
|
|
27
27
|
kasa/cli/discover.py,sha256=3FF_CsfbTsd8zsNidOCTDLbHLfVnrc0Fae3FSpPiag4,4742
|
|
28
28
|
kasa/cli/feature.py,sha256=3cm33EuTHDwGX4AX9rZHCIp0J2YHowWeE6O3Rg9EQ0w,3486
|
|
29
29
|
kasa/cli/lazygroup.py,sha256=KBm-21HwxiOnO8houCTBGkPjQiW3cwoCm4DlvJyGzI0,2486
|
|
@@ -42,8 +42,8 @@ kasa/interfaces/lighteffect.py,sha256=r42muGmJdjFKGFjqt6RJZUApfaLddrtkbkX-kD7eHy
|
|
|
42
42
|
kasa/interfaces/lightpreset.py,sha256=oDIilwkSV03EJ-TgwblFhKavFh6JzXQ3uBAw2t8lNJo,4070
|
|
43
43
|
kasa/iot/__init__.py,sha256=k0QlxHTzb_btqNIIpUd9ybDo-CjkQLa1DReyAkTfs4I,399
|
|
44
44
|
kasa/iot/effects.py,sha256=au35HDrHso7JRdv9bPSdkepdpR8NbSp-gFGHW2SKZUw,7506
|
|
45
|
-
kasa/iot/iotbulb.py,sha256=
|
|
46
|
-
kasa/iot/iotdevice.py,sha256=
|
|
45
|
+
kasa/iot/iotbulb.py,sha256=_zQbQShjJQZ9SBD5POzir1dNpNPDKzDpqQg72licV58,18475
|
|
46
|
+
kasa/iot/iotdevice.py,sha256=Apsbz5w3f7H2C73UWivIFO3ShBa845U1ofGPktMtuaI,22883
|
|
47
47
|
kasa/iot/iotdimmer.py,sha256=aWHgpw7B8XF_t5s3fOPoAJilV8vpFl2H6kUQIH0Qc4g,7780
|
|
48
48
|
kasa/iot/iotlightstrip.py,sha256=uJ9EeN1qiyTcOKhc2Hwso3_1TQMKg1cv4yIUFYpgX5U,2104
|
|
49
49
|
kasa/iot/iotmodule.py,sha256=M3OHij6gq4J49Ybsd1QUhEn8W-VXxoF6FMkn2IcSyDo,2095
|
|
@@ -97,8 +97,8 @@ kasa/smart/modules/temperaturecontrol.py,sha256=yE8Y3r2eJAXfPhBzDxvKpr-O7hWUD00L
|
|
|
97
97
|
kasa/smart/modules/temperaturesensor.py,sha256=MFF_27r1ryxQUit2avKo6pZfhuzWSrTVKYqMZgyOVv8,2734
|
|
98
98
|
kasa/smart/modules/time.py,sha256=CITnlRTe0z48DL2KHu18UDeGLKCy629eghYPq3MOHo8,1891
|
|
99
99
|
kasa/smart/modules/waterleaksensor.py,sha256=yoQtSjM1MO9sMpU2ldtWzHcTPPd7okZNWvjSXmkb4h0,1880
|
|
100
|
-
python_kasa-0.7.
|
|
101
|
-
python_kasa-0.7.
|
|
102
|
-
python_kasa-0.7.
|
|
103
|
-
python_kasa-0.7.
|
|
104
|
-
python_kasa-0.7.
|
|
100
|
+
python_kasa-0.7.4.dist-info/METADATA,sha256=layrDibH3At3DPU6_87rd0pWb4CQJYKaakUODg9kV7Y,11682
|
|
101
|
+
python_kasa-0.7.4.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
102
|
+
python_kasa-0.7.4.dist-info/entry_points.txt,sha256=gTVS_oUcmt4q77WSkppQofMelqufh0zeXvvUkmBPRJA,47
|
|
103
|
+
python_kasa-0.7.4.dist-info/licenses/LICENSE,sha256=Klt9aEsei738epLgYqeikhpdBWwMvU1VAli14Bxlc5c,33218
|
|
104
|
+
python_kasa-0.7.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|