python-kasa 0.7.1__tar.gz → 0.7.2__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.
Files changed (273) hide show
  1. {python_kasa-0.7.1 → python_kasa-0.7.2}/CHANGELOG.md +42 -6
  2. {python_kasa-0.7.1 → python_kasa-0.7.2}/PKG-INFO +2 -1
  3. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/aestransport.py +1 -2
  4. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/device_factory.py +5 -2
  5. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/discover.py +1 -1
  6. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/emeterstatus.py +1 -1
  7. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/feature.py +3 -2
  8. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/iotbulb.py +9 -3
  9. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/iotdevice.py +3 -14
  10. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/iotdimmer.py +8 -8
  11. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/iotmodule.py +9 -8
  12. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/klaptransport.py +14 -14
  13. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/color.py +11 -5
  14. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/firmware.py +51 -24
  15. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/lighteffect.py +1 -1
  16. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/smartmodule.py +1 -1
  17. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smartprotocol.py +3 -2
  18. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/conftest.py +1 -1
  19. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/discovery_fixtures.py +2 -2
  20. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fakeprotocol_iot.py +3 -1
  21. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/features/test_brightness.py +8 -6
  22. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/features/test_colortemp.py +2 -2
  23. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_autooff.py +1 -1
  24. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_contact.py +1 -1
  25. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_fan.py +2 -2
  26. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_firmware.py +35 -5
  27. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_humidity.py +1 -1
  28. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_light_effect.py +1 -1
  29. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_light_strip_effect.py +1 -1
  30. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_motionsensor.py +1 -1
  31. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_temperature.py +1 -1
  32. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_temperaturecontrol.py +16 -7
  33. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_waterleak.py +1 -1
  34. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_aestransport.py +3 -3
  35. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_bulb.py +80 -21
  36. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_common_modules.py +12 -14
  37. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_device.py +4 -2
  38. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_dimmer.py +30 -10
  39. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_discovery.py +4 -4
  40. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_emeter.py +2 -2
  41. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_feature.py +4 -4
  42. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_httpclient.py +2 -2
  43. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_iotdevice.py +20 -1
  44. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_klapprotocol.py +6 -6
  45. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_lightstrip.py +3 -1
  46. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_protocol.py +22 -29
  47. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_readme_examples.py +3 -49
  48. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_smartprotocol.py +1 -1
  49. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_usage.py +2 -1
  50. {python_kasa-0.7.1 → python_kasa-0.7.2}/pyproject.toml +6 -2
  51. {python_kasa-0.7.1 → python_kasa-0.7.2}/LICENSE +0 -0
  52. {python_kasa-0.7.1 → python_kasa-0.7.2}/README.md +0 -0
  53. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/__init__.py +0 -0
  54. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/__init__.py +0 -0
  55. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/__main__.py +0 -0
  56. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/common.py +0 -0
  57. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/device.py +0 -0
  58. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/discover.py +0 -0
  59. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/feature.py +0 -0
  60. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/lazygroup.py +0 -0
  61. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/light.py +0 -0
  62. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/main.py +0 -0
  63. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/schedule.py +0 -0
  64. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/time.py +0 -0
  65. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/usage.py +0 -0
  66. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/cli/wifi.py +0 -0
  67. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/credentials.py +0 -0
  68. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/device.py +0 -0
  69. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/device_type.py +0 -0
  70. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/deviceconfig.py +0 -0
  71. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/exceptions.py +0 -0
  72. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/httpclient.py +0 -0
  73. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/interfaces/__init__.py +0 -0
  74. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/interfaces/energy.py +0 -0
  75. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/interfaces/fan.py +0 -0
  76. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/interfaces/led.py +0 -0
  77. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/interfaces/light.py +0 -0
  78. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/interfaces/lighteffect.py +0 -0
  79. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/interfaces/lightpreset.py +0 -0
  80. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/__init__.py +0 -0
  81. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/effects.py +0 -0
  82. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/iotlightstrip.py +0 -0
  83. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/iotplug.py +0 -0
  84. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/iotstrip.py +0 -0
  85. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/__init__.py +0 -0
  86. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/ambientlight.py +0 -0
  87. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/antitheft.py +0 -0
  88. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/cloud.py +0 -0
  89. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/countdown.py +0 -0
  90. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/emeter.py +0 -0
  91. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/led.py +0 -0
  92. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/light.py +0 -0
  93. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/lighteffect.py +0 -0
  94. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/lightpreset.py +0 -0
  95. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/motion.py +0 -0
  96. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/rulemodule.py +0 -0
  97. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/schedule.py +0 -0
  98. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/time.py +0 -0
  99. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iot/modules/usage.py +0 -0
  100. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/iotprotocol.py +0 -0
  101. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/json.py +0 -0
  102. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/module.py +0 -0
  103. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/modulemapping.py +0 -0
  104. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/modulemapping.pyi +0 -0
  105. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/protocol.py +0 -0
  106. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/py.typed +0 -0
  107. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/__init__.py +0 -0
  108. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/effects.py +0 -0
  109. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/__init__.py +0 -0
  110. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/alarm.py +0 -0
  111. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/autooff.py +0 -0
  112. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/batterysensor.py +0 -0
  113. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/brightness.py +0 -0
  114. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/childdevice.py +0 -0
  115. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/cloud.py +0 -0
  116. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/colortemperature.py +0 -0
  117. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/contactsensor.py +0 -0
  118. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/devicemodule.py +0 -0
  119. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/energy.py +0 -0
  120. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/fan.py +0 -0
  121. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/frostprotection.py +0 -0
  122. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/humiditysensor.py +0 -0
  123. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/led.py +0 -0
  124. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/light.py +0 -0
  125. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/lightpreset.py +0 -0
  126. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/lightstripeffect.py +0 -0
  127. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/lighttransition.py +0 -0
  128. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/motionsensor.py +0 -0
  129. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/reportmode.py +0 -0
  130. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/temperaturecontrol.py +0 -0
  131. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/temperaturesensor.py +0 -0
  132. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/time.py +0 -0
  133. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/modules/waterleaksensor.py +0 -0
  134. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/smartchilddevice.py +0 -0
  135. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/smart/smartdevice.py +0 -0
  136. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/__init__.py +0 -0
  137. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/device_fixtures.py +0 -0
  138. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fakeprotocol_smart.py +0 -0
  139. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtureinfo.py +0 -0
  140. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/EP10(US)_1.0_1.0.2.json +0 -0
  141. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/EP40(US)_1.0_1.0.2.json +0 -0
  142. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/ES20M(US)_1.0_1.0.8.json +0 -0
  143. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS100(UK)_1.0_1.2.6.json +0 -0
  144. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS100(UK)_4.1_1.1.0.json +0 -0
  145. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS100(US)_1.0_1.2.5.json +0 -0
  146. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS100(US)_2.0_1.5.6.json +0 -0
  147. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS103(US)_1.0_1.5.7.json +0 -0
  148. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS103(US)_2.1_1.1.2.json +0 -0
  149. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS103(US)_2.1_1.1.4.json +0 -0
  150. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS105(US)_1.0_1.5.6.json +0 -0
  151. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS107(US)_1.0_1.0.8.json +0 -0
  152. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS110(EU)_1.0_1.2.5.json +0 -0
  153. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS110(EU)_4.0_1.0.4.json +0 -0
  154. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS110(US)_1.0_1.2.6.json +0 -0
  155. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS200(US)_2.0_1.5.7.json +0 -0
  156. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS200(US)_5.0_1.0.2.json +0 -0
  157. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS210(US)_1.0_1.5.8.json +0 -0
  158. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS220(US)_1.0_1.5.7.json +0 -0
  159. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS220(US)_2.0_1.0.3.json +0 -0
  160. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS300(US)_1.0_1.0.10.json +0 -0
  161. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS300(US)_1.0_1.0.21.json +0 -0
  162. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS300(US)_2.0_1.0.12.json +0 -0
  163. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/HS300(US)_2.0_1.0.3.json +0 -0
  164. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL110(US)_1.0_1.8.11.json +0 -0
  165. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL120(US)_1.0_1.8.11.json +0 -0
  166. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL120(US)_1.0_1.8.6.json +0 -0
  167. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL125(US)_1.20_1.0.5.json +0 -0
  168. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL125(US)_2.0_1.0.7.json +0 -0
  169. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL125(US)_4.0_1.0.5.json +0 -0
  170. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL130(EU)_1.0_1.8.8.json +0 -0
  171. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL130(US)_1.0_1.8.11.json +0 -0
  172. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL135(US)_1.0_1.0.6.json +0 -0
  173. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL400L5(US)_1.0_1.0.5.json +0 -0
  174. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL400L5(US)_1.0_1.0.8.json +0 -0
  175. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL420L5(US)_1.0_1.0.2.json +0 -0
  176. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL430(UN)_2.0_1.0.8.json +0 -0
  177. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL430(US)_1.0_1.0.10.json +0 -0
  178. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL430(US)_2.0_1.0.11.json +0 -0
  179. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL430(US)_2.0_1.0.8.json +0 -0
  180. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL430(US)_2.0_1.0.9.json +0 -0
  181. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL50(US)_1.0_1.1.13.json +0 -0
  182. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL60(UN)_1.0_1.1.4.json +0 -0
  183. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KL60(US)_1.0_1.1.13.json +0 -0
  184. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP100(US)_3.0_1.0.1.json +0 -0
  185. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP105(UK)_1.0_1.0.5.json +0 -0
  186. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP105(UK)_1.0_1.0.7.json +0 -0
  187. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP115(EU)_1.0_1.0.16.json +0 -0
  188. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP115(US)_1.0_1.0.17.json +0 -0
  189. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP115(US)_1.0_1.0.21.json +0 -0
  190. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP125(US)_1.0_1.0.6.json +0 -0
  191. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP200(US)_3.0_1.0.3.json +0 -0
  192. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP303(UK)_1.0_1.0.3.json +0 -0
  193. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP303(US)_2.0_1.0.3.json +0 -0
  194. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP400(US)_1.0_1.0.10.json +0 -0
  195. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP400(US)_2.0_1.0.6.json +0 -0
  196. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP400(US)_3.0_1.0.3.json +0 -0
  197. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP400(US)_3.0_1.0.4.json +0 -0
  198. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP401(US)_1.0_1.0.0.json +0 -0
  199. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP405(US)_1.0_1.0.5.json +0 -0
  200. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KP405(US)_1.0_1.0.6.json +0 -0
  201. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KS200M(US)_1.0_1.0.11.json +0 -0
  202. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KS200M(US)_1.0_1.0.8.json +0 -0
  203. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KS220M(US)_1.0_1.0.4.json +0 -0
  204. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/KS230(US)_1.0_1.0.14.json +0 -0
  205. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/LB110(US)_1.0_1.8.11.json +0 -0
  206. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.1.json +0 -0
  207. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/EP25(US)_2.6_1.0.2.json +0 -0
  208. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.2.3.json +0 -0
  209. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.10.json +0 -0
  210. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/H100(EU)_1.0_1.5.5.json +0 -0
  211. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/HS220(US)_3.26_1.0.1.json +0 -0
  212. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/KH100(UK)_1.0_1.5.6.json +0 -0
  213. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/KP125M(US)_1.0_1.1.3.json +0 -0
  214. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/KS205(US)_1.0_1.0.2.json +0 -0
  215. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/KS205(US)_1.0_1.1.0.json +0 -0
  216. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/KS225(US)_1.0_1.0.2.json +0 -0
  217. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/KS225(US)_1.0_1.1.0.json +0 -0
  218. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/KS240(US)_1.0_1.0.4.json +0 -0
  219. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/KS240(US)_1.0_1.0.5.json +0 -0
  220. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L510B(EU)_3.0_1.0.5.json +0 -0
  221. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L510E(US)_3.0_1.0.5.json +0 -0
  222. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L510E(US)_3.0_1.1.2.json +0 -0
  223. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.0.6.json +0 -0
  224. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.1.0.json +0 -0
  225. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L530E(EU)_3.0_1.1.6.json +0 -0
  226. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L530E(US)_2.0_1.1.0.json +0 -0
  227. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L900-10(EU)_1.0_1.0.17.json +0 -0
  228. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L900-10(US)_1.0_1.0.11.json +0 -0
  229. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L900-5(EU)_1.0_1.0.17.json +0 -0
  230. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L900-5(EU)_1.0_1.1.0.json +0 -0
  231. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L920-5(EU)_1.0_1.0.7.json +0 -0
  232. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L920-5(EU)_1.0_1.1.3.json +0 -0
  233. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L920-5(US)_1.0_1.1.0.json +0 -0
  234. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L920-5(US)_1.0_1.1.3.json +0 -0
  235. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/L930-5(US)_1.0_1.1.2.json +0 -0
  236. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P100_1.0.0_1.1.3.json +0 -0
  237. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P100_1.0.0_1.3.7.json +0 -0
  238. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P100_1.0.0_1.4.0.json +0 -0
  239. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P110(EU)_1.0_1.0.7.json +0 -0
  240. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P110(EU)_1.0_1.2.3.json +0 -0
  241. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P110(UK)_1.0_1.3.0.json +0 -0
  242. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P115(EU)_1.0_1.2.3.json +0 -0
  243. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P125M(US)_1.0_1.1.0.json +0 -0
  244. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P135(US)_1.0_1.0.5.json +0 -0
  245. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.13.json +0 -0
  246. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.15.json +0 -0
  247. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.7.json +0 -0
  248. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/S500D(US)_1.0_1.0.5.json +0 -0
  249. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/S505(US)_1.0_1.0.2.json +0 -0
  250. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/S505D(US)_1.0_1.1.0.json +0 -0
  251. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/TP15(US)_1.0_1.0.3.json +0 -0
  252. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/TP25(US)_1.0_1.0.2.json +0 -0
  253. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/child/KE100(EU)_1.0_2.4.0.json +0 -0
  254. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/child/KE100(EU)_1.0_2.8.0.json +0 -0
  255. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/child/KE100(UK)_1.0_2.8.0.json +0 -0
  256. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/child/T100(EU)_1.0_1.12.0.json +0 -0
  257. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/child/T110(EU)_1.0_1.8.0.json +0 -0
  258. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/child/T300(EU)_1.0_1.7.0.json +0 -0
  259. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/child/T310(EU)_1.0_1.5.0.json +0 -0
  260. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/fixtures/smart/child/T315(EU)_1.0_1.7.0.json +0 -0
  261. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/__init__.py +0 -0
  262. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/features/__init__.py +0 -0
  263. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/__init__.py +0 -0
  264. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/smart/modules/test_lighttransition.py +0 -0
  265. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_childdevice.py +0 -0
  266. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_cli.py +0 -0
  267. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_device_factory.py +0 -0
  268. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_device_type.py +0 -0
  269. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_deviceconfig.py +0 -0
  270. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_plug.py +0 -0
  271. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_smartdevice.py +0 -0
  272. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/tests/test_strip.py +0 -0
  273. {python_kasa-0.7.1 → python_kasa-0.7.2}/kasa/xortransport.py +0 -0
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.2](https://github.com/python-kasa/python-kasa/tree/0.7.2) (2024-08-30)
4
+
5
+ [Full Changelog](https://github.com/python-kasa/python-kasa/compare/0.7.1...0.7.2)
6
+
7
+ **Release summary:**
8
+
9
+ - **Breaking** change to disable including the check for the latest firmware for tapo devices and newer kasa devices in the standard update cycle. To check for the latest firmware call `check_latest_firmware` on the firmware module or run the `check_latest_firmware` feature.
10
+ - Minor bugfixes and improvements.
11
+
12
+ **Breaking changes:**
13
+
14
+ - Disable automatic updating of latest firmware [\#1103](https://github.com/python-kasa/python-kasa/pull/1103) (@sdb9696)
15
+
16
+ **Implemented enhancements:**
17
+
18
+ - Improve performance of dict merge code [\#1097](https://github.com/python-kasa/python-kasa/pull/1097) (@bdraco)
19
+
20
+ **Fixed bugs:**
21
+
22
+ - Fix logging in iotdevice when a module is module not supported [\#1100](https://github.com/python-kasa/python-kasa/pull/1100) (@bdraco)
23
+
24
+ **Documentation updates:**
25
+
26
+ - Fix incorrect docs link in contributing.md [\#1099](https://github.com/python-kasa/python-kasa/pull/1099) (@sdb9696)
27
+
28
+ **Project maintenance:**
29
+
30
+ - Add flake8-pytest-style \(PT\) for ruff [\#1105](https://github.com/python-kasa/python-kasa/pull/1105) (@rytilahti)
31
+ - Add flake8-logging \(LOG\) and flake8-logging-format \(G\) for ruff [\#1104](https://github.com/python-kasa/python-kasa/pull/1104) (@rytilahti)
32
+ - Add missing typing\_extensions dependency [\#1101](https://github.com/python-kasa/python-kasa/pull/1101) (@sdb9696)
33
+ - Remove top level await xdoctest fixture [\#1098](https://github.com/python-kasa/python-kasa/pull/1098) (@sdb9696)
34
+ - Enable python 3.13, allow pre-releases for CI [\#1086](https://github.com/python-kasa/python-kasa/pull/1086) (@rytilahti)
35
+
3
36
  ## [0.7.1](https://github.com/python-kasa/python-kasa/tree/0.7.1) (2024-07-31)
4
37
 
5
38
  [Full Changelog](https://github.com/python-kasa/python-kasa/compare/0.7.0.5...0.7.1)
@@ -17,6 +50,8 @@
17
50
 
18
51
  **Fixed bugs:**
19
52
 
53
+ - Error connecting to L920-5 Smart LED Strip [\#1040](https://github.com/python-kasa/python-kasa/issues/1040)
54
+ - Handle module errors more robustly and add query params to light preset and transition [\#1036](https://github.com/python-kasa/python-kasa/pull/1036) (@sdb9696)
20
55
  - Fix iot light effect brightness [\#1092](https://github.com/python-kasa/python-kasa/pull/1092) (@sdb9696)
21
56
  - Enable setting brightness with color temp for smart devices [\#1091](https://github.com/python-kasa/python-kasa/pull/1091) (@sdb9696)
22
57
  - Do not send light\_on value to iot bulb set\_state [\#1090](https://github.com/python-kasa/python-kasa/pull/1090) (@sdb9696)
@@ -24,7 +59,6 @@
24
59
  - Raise KasaException on decryption errors [\#1078](https://github.com/python-kasa/python-kasa/pull/1078) (@sdb9696)
25
60
  - Update smart request parameter handling [\#1061](https://github.com/python-kasa/python-kasa/pull/1061) (@sdb9696)
26
61
  - Fix light preset module when list contains lighting effects [\#1048](https://github.com/python-kasa/python-kasa/pull/1048) (@sdb9696)
27
- - Handle module errors more robustly and add query params to light preset and transition [\#1036](https://github.com/python-kasa/python-kasa/pull/1036) (@sdb9696)
28
62
  - Fix credential hash to return None on empty credentials [\#1029](https://github.com/python-kasa/python-kasa/pull/1029) (@sdb9696)
29
63
 
30
64
  **Added support for devices:**
@@ -34,6 +68,9 @@
34
68
  **Project maintenance:**
35
69
 
36
70
  - Bump project version to 0.7.0.5 [\#1087](https://github.com/python-kasa/python-kasa/pull/1087) (@sdb9696)
71
+ - Add KP400\(US\) v1.0.4 fixture [\#1051](https://github.com/python-kasa/python-kasa/pull/1051) (@gimpy88)
72
+ - Add new HS220 kasa aes fixture [\#1050](https://github.com/python-kasa/python-kasa/pull/1050) (@sdb9696)
73
+ - Add KS205\(US\) v1.1.0 fixture [\#1049](https://github.com/python-kasa/python-kasa/pull/1049) (@gimpy88)
37
74
  - Fix generate\_supported pre commit to run in venv [\#1085](https://github.com/python-kasa/python-kasa/pull/1085) (@sdb9696)
38
75
  - Fix intermittently failing decryption error test [\#1082](https://github.com/python-kasa/python-kasa/pull/1082) (@sdb9696)
39
76
  - Fix mypy pre-commit hook on windows [\#1081](https://github.com/python-kasa/python-kasa/pull/1081) (@sdb9696)
@@ -42,9 +79,6 @@
42
79
  - Fix parse\_pcap\_klap on windows and support default credentials [\#1068](https://github.com/python-kasa/python-kasa/pull/1068) (@sdb9696)
43
80
  - Add fixture file for KP405 fw 1.0.6 [\#1063](https://github.com/python-kasa/python-kasa/pull/1063) (@daleye)
44
81
  - Bump project version to 0.7.0.3 [\#1053](https://github.com/python-kasa/python-kasa/pull/1053) (@sdb9696)
45
- - Add KP400\(US\) v1.0.4 fixture [\#1051](https://github.com/python-kasa/python-kasa/pull/1051) (@gimpy88)
46
- - Add new HS220 kasa aes fixture [\#1050](https://github.com/python-kasa/python-kasa/pull/1050) (@sdb9696)
47
- - Add KS205\(US\) v1.1.0 fixture [\#1049](https://github.com/python-kasa/python-kasa/pull/1049) (@gimpy88)
48
82
  - Add KS200M\(US\) v1.0.11 fixture [\#1047](https://github.com/python-kasa/python-kasa/pull/1047) (@sdb9696)
49
83
  - Add KS225\(US\) v1.1.0 fixture [\#1046](https://github.com/python-kasa/python-kasa/pull/1046) (@sdb9696)
50
84
  - Split out main cli module into lazily loaded submodules [\#1039](https://github.com/python-kasa/python-kasa/pull/1039) (@sdb9696)
@@ -76,7 +110,6 @@ Critical bugfixes for issues with P100s and thermostats
76
110
 
77
111
  **Fixed bugs:**
78
112
 
79
- - Error connecting to L920-5 Smart LED Strip [\#1040](https://github.com/python-kasa/python-kasa/issues/1040)
80
113
  - Use first known thermostat state as main state \(pick \#1054\) [\#1057](https://github.com/python-kasa/python-kasa/pull/1057) (@sdb9696)
81
114
  - Defer module updates for less volatile modules \(pick 1052\) [\#1056](https://github.com/python-kasa/python-kasa/pull/1056) (@sdb9696)
82
115
  - Use first known thermostat state as main state [\#1054](https://github.com/python-kasa/python-kasa/pull/1054) (@rytilahti)
@@ -945,6 +978,10 @@ Pull requests improving the functionality of modules as well as adding better in
945
978
  - Improve poetry usage documentation [\#60](https://github.com/python-kasa/python-kasa/issues/60)
946
979
  - Improve cli documentation for bulbs and power strips [\#123](https://github.com/python-kasa/python-kasa/pull/123) (@rytilahti)
947
980
 
981
+ **Project maintenance:**
982
+
983
+ - Add HS220 hw 2.0 fixture [\#107](https://github.com/python-kasa/python-kasa/pull/107) (@appleguru)
984
+
948
985
  **Merged pull requests:**
949
986
 
950
987
  - Add github workflow for pypi publishing [\#220](https://github.com/python-kasa/python-kasa/pull/220) (@rytilahti)
@@ -967,7 +1004,6 @@ Pull requests improving the functionality of modules as well as adding better in
967
1004
  - Fix documentation on Smart strips [\#136](https://github.com/python-kasa/python-kasa/pull/136) (@flavio-fernandes)
968
1005
  - add tapo link, fix tplink-smarthome-simulator link [\#133](https://github.com/python-kasa/python-kasa/pull/133) (@rytilahti)
969
1006
  - Leverage data from UDP discovery to initialize device structure [\#132](https://github.com/python-kasa/python-kasa/pull/132) (@dlee1j1)
970
- - Add HS220 hw 2.0 fixture [\#107](https://github.com/python-kasa/python-kasa/pull/107) (@appleguru)
971
1007
  - Pin dependencies on major versions, add poetry.lock [\#94](https://github.com/python-kasa/python-kasa/pull/94) (@rytilahti)
972
1008
  - add a small example script to show library usage [\#90](https://github.com/python-kasa/python-kasa/pull/90) (@rytilahti)
973
1009
  - add .readthedocs.yml required for poetry builds [\#89](https://github.com/python-kasa/python-kasa/pull/89) (@rytilahti)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-kasa
3
- Version: 0.7.1
3
+ Version: 0.7.2
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
@@ -29,6 +29,7 @@ Requires-Dist: rich ; extra == "shell"
29
29
  Requires-Dist: sphinx (>=5,<6) ; extra == "docs"
30
30
  Requires-Dist: sphinx_rtd_theme (>=2,<3) ; extra == "docs"
31
31
  Requires-Dist: sphinxcontrib-programoutput (>=0,<1) ; extra == "docs"
32
+ Requires-Dist: typing-extensions (>=4.12.2,<5.0)
32
33
  Project-URL: Bug Tracker, https://github.com/python-kasa/python-kasa/issues
33
34
  Project-URL: Documentation, https://python-kasa.readthedocs.io
34
35
  Project-URL: Repository, https://github.com/python-kasa/python-kasa
@@ -278,9 +278,8 @@ class AesTransport(BaseTransport):
278
278
  + "\n-----END PUBLIC KEY-----\n"
279
279
  )
280
280
  handshake_params = {"key": pub_key}
281
- _LOGGER.debug(f"Handshake params: {handshake_params}")
282
281
  request_body = {"method": "handshake", "params": handshake_params}
283
- _LOGGER.debug(f"Request {request_body}")
282
+ _LOGGER.debug("Handshake request: %s", request_body)
284
283
  yield json_dumps(request_body).encode()
285
284
 
286
285
  async def perform_handshake(self) -> None:
@@ -84,8 +84,11 @@ async def _connect(config: DeviceConfig, protocol: BaseProtocol) -> Device:
84
84
  if debug_enabled:
85
85
  end_time = time.perf_counter()
86
86
  _LOGGER.debug(
87
- f"Device {config.host} with connection params {has_params} "
88
- + f"took {end_time - start_time:.2f} seconds to {perf_type}",
87
+ "Device %s with connection params %s took %.2f seconds to %s",
88
+ config.host,
89
+ has_params,
90
+ end_time - start_time,
91
+ perf_type,
89
92
  )
90
93
  start_time = time.perf_counter()
91
94
 
@@ -262,7 +262,7 @@ class _DiscoverProtocol(asyncio.DatagramProtocol):
262
262
  self._handle_discovered_event()
263
263
  return
264
264
  except KasaException as ex:
265
- _LOGGER.debug(f"[DISCOVERY] Unable to find device type for {ip}: {ex}")
265
+ _LOGGER.debug("[DISCOVERY] Unable to find device type for %s: %s", ip, ex)
266
266
  self.invalid_device_exceptions[ip] = ex
267
267
  self._handle_discovered_event()
268
268
  return
@@ -87,5 +87,5 @@ class EmeterStatus(dict):
87
87
  ):
88
88
  return value / 1000
89
89
 
90
- _LOGGER.debug(f"Unable to find value for '{item}'")
90
+ _LOGGER.debug("Unable to find value for '%s'", item)
91
91
  return None
@@ -31,9 +31,10 @@ Cloud connection (cloud_connection): True
31
31
  HSV (hsv): HSV(hue=0, saturation=100, value=100)
32
32
  Color temperature (color_temperature): 2700
33
33
  Auto update enabled (auto_update_enabled): False
34
- Update available (update_available): False
34
+ Update available (update_available): None
35
35
  Current firmware version (current_firmware_version): 1.1.6 Build 240130 Rel.173828
36
- Available firmware version (available_firmware_version): 1.1.6 Build 240130 Rel.173828
36
+ Available firmware version (available_firmware_version): None
37
+ Check latest firmware (check_latest_firmware): <Action>
37
38
  Light effect (light_effect): Off
38
39
  Light preset (light_preset): Not set
39
40
  Smooth transition on (smooth_transition_on): 2
@@ -388,10 +388,14 @@ class IotBulb(IotDevice):
388
388
  if not self._is_color:
389
389
  raise KasaException("Bulb does not support color.")
390
390
 
391
- if not isinstance(hue, int) or not (0 <= hue <= 360):
391
+ if not isinstance(hue, int):
392
+ raise TypeError("Hue must be an integer.")
393
+ if not (0 <= hue <= 360):
392
394
  raise ValueError(f"Invalid hue value: {hue} (valid range: 0-360)")
393
395
 
394
- if not isinstance(saturation, int) or not (0 <= saturation <= 100):
396
+ if not isinstance(saturation, int):
397
+ raise TypeError("Saturation must be an integer.")
398
+ if not (0 <= saturation <= 100):
395
399
  raise ValueError(
396
400
  f"Invalid saturation value: {saturation} (valid range: 0-100%)"
397
401
  )
@@ -445,7 +449,9 @@ class IotBulb(IotDevice):
445
449
  return await self._set_light_state(light_state, transition=transition)
446
450
 
447
451
  def _raise_for_invalid_brightness(self, value):
448
- if not isinstance(value, int) or not (0 <= value <= 100):
452
+ if not isinstance(value, int):
453
+ raise TypeError("Brightness must be an integer")
454
+ if not (0 <= value <= 100):
449
455
  raise ValueError(f"Invalid brightness value: {value} (valid range: 0-100%)")
450
456
 
451
457
  @property # type: ignore
@@ -14,7 +14,6 @@ http://www.apache.org/licenses/LICENSE-2.0
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- import collections.abc
18
17
  import functools
19
18
  import inspect
20
19
  import logging
@@ -29,22 +28,12 @@ from ..feature import Feature
29
28
  from ..module import Module
30
29
  from ..modulemapping import ModuleMapping, ModuleName
31
30
  from ..protocol import BaseProtocol
32
- from .iotmodule import IotModule
31
+ from .iotmodule import IotModule, merge
33
32
  from .modules import Emeter
34
33
 
35
34
  _LOGGER = logging.getLogger(__name__)
36
35
 
37
36
 
38
- def merge(d, u):
39
- """Update dict recursively."""
40
- for k, v in u.items():
41
- if isinstance(v, collections.abc.Mapping):
42
- d[k] = merge(d.get(k, {}), v)
43
- else:
44
- d[k] = v
45
- return d
46
-
47
-
48
37
  def requires_update(f):
49
38
  """Indicate that `update` should be called before accessing this method.""" # noqa: D202
50
39
  if inspect.iscoroutinefunction(f):
@@ -209,7 +198,7 @@ class IotDevice(Device):
209
198
  def add_module(self, name: str | ModuleName[Module], module: IotModule):
210
199
  """Register a module."""
211
200
  if name in self._modules:
212
- _LOGGER.debug("Module %s already registered, ignoring..." % name)
201
+ _LOGGER.debug("Module %s already registered, ignoring...", name)
213
202
  return
214
203
 
215
204
  _LOGGER.debug("Adding module %s", module)
@@ -382,7 +371,7 @@ class IotDevice(Device):
382
371
  est_response_size = 1024 if "system" in req else 0
383
372
  for module in self._modules.values():
384
373
  if not module.is_supported:
385
- _LOGGER.debug("Module %s not supported, skipping" % module)
374
+ _LOGGER.debug("Module %s not supported, skipping", module)
386
375
  continue
387
376
 
388
377
  est_response_size += module.estimated_query_response_size
@@ -118,7 +118,9 @@ class IotDimmer(IotPlug):
118
118
  )
119
119
 
120
120
  if not 0 <= brightness <= 100:
121
- raise ValueError("Brightness value %s is not valid." % brightness)
121
+ raise ValueError(
122
+ f"Invalid brightness value: {brightness} (valid range: 0-100%)"
123
+ )
122
124
 
123
125
  # Dimmers do not support a brightness of 0, but bulbs do.
124
126
  # Coerce 0 to 1 to maintain the same interface between dimmers and bulbs.
@@ -161,20 +163,18 @@ class IotDimmer(IotPlug):
161
163
  A brightness value of 0 will turn off the dimmer.
162
164
  """
163
165
  if not isinstance(brightness, int):
164
- raise ValueError(
165
- "Brightness must be integer, " "not of %s.", type(brightness)
166
- )
166
+ raise TypeError(f"Brightness must be an integer, not {type(brightness)}.")
167
167
 
168
168
  if not 0 <= brightness <= 100:
169
- raise ValueError("Brightness value %s is not valid." % brightness)
169
+ raise ValueError(
170
+ f"Invalid brightness value: {brightness} (valid range: 0-100%)"
171
+ )
170
172
 
171
173
  # If zero set to 1 millisecond
172
174
  if transition == 0:
173
175
  transition = 1
174
176
  if not isinstance(transition, int):
175
- raise ValueError(
176
- "Transition must be integer, " "not of %s.", type(transition)
177
- )
177
+ raise TypeError(f"Transition must be integer, not of {type(transition)}.")
178
178
  if transition <= 0:
179
179
  raise ValueError("Transition value %s is not valid." % transition)
180
180
 
@@ -1,6 +1,5 @@
1
1
  """Base class for IOT module implementations."""
2
2
 
3
- import collections
4
3
  import logging
5
4
 
6
5
  from ..exceptions import KasaException
@@ -9,15 +8,17 @@ from ..module import Module
9
8
  _LOGGER = logging.getLogger(__name__)
10
9
 
11
10
 
12
- # TODO: This is used for query constructing, check for a better place
13
- def merge(d, u):
11
+ def _merge_dict(dest: dict, source: dict) -> dict:
14
12
  """Update dict recursively."""
15
- for k, v in u.items():
16
- if isinstance(v, collections.abc.Mapping):
17
- d[k] = merge(d.get(k, {}), v)
13
+ for k, v in source.items():
14
+ if k in dest and type(v) is dict: # noqa: E721 - only accepts `dict` type
15
+ _merge_dict(dest[k], v)
18
16
  else:
19
- d[k] = v
20
- return d
17
+ dest[k] = v
18
+ return dest
19
+
20
+
21
+ merge = _merge_dict
21
22
 
22
23
 
23
24
  class IotModule(Module):
@@ -153,8 +153,8 @@ class KlapTransport(BaseTransport):
153
153
 
154
154
  if _LOGGER.isEnabledFor(logging.DEBUG):
155
155
  _LOGGER.debug(
156
- "Handshake1 posted at %s. Host is %s, Response"
157
- + "status is %s, Request was %s",
156
+ "Handshake1 posted at %s. Host is %s, "
157
+ "Response status is %s, Request was %s",
158
158
  datetime.datetime.now(),
159
159
  self._host,
160
160
  response_status,
@@ -179,7 +179,7 @@ class KlapTransport(BaseTransport):
179
179
  if _LOGGER.isEnabledFor(logging.DEBUG):
180
180
  _LOGGER.debug(
181
181
  "Handshake1 success at %s. Host is %s, "
182
- + "Server remote_seed is: %s, server hash is: %s",
182
+ "Server remote_seed is: %s, server hash is: %s",
183
183
  datetime.datetime.now(),
184
184
  self._host,
185
185
  remote_seed.hex(),
@@ -211,9 +211,10 @@ class KlapTransport(BaseTransport):
211
211
 
212
212
  if default_credentials_seed_auth_hash == server_hash:
213
213
  _LOGGER.debug(
214
- "Server response doesn't match our expected hash on ip %s"
215
- + f" but an authentication with {key} default credentials matched",
214
+ "Server response doesn't match our expected hash on ip %s, "
215
+ "but an authentication with %s default credentials matched",
216
216
  self._host,
217
+ key,
217
218
  )
218
219
  return local_seed, remote_seed, self._default_credentials_auth_hash[key] # type: ignore
219
220
 
@@ -231,8 +232,8 @@ class KlapTransport(BaseTransport):
231
232
 
232
233
  if blank_seed_auth_hash == server_hash:
233
234
  _LOGGER.debug(
234
- "Server response doesn't match our expected hash on ip %s"
235
- + " but an authentication with blank credentials matched",
235
+ "Server response doesn't match our expected hash on ip %s, "
236
+ "but an authentication with blank credentials matched",
236
237
  self._host,
237
238
  )
238
239
  return local_seed, remote_seed, self._blank_auth_hash # type: ignore
@@ -260,8 +261,8 @@ class KlapTransport(BaseTransport):
260
261
 
261
262
  if _LOGGER.isEnabledFor(logging.DEBUG):
262
263
  _LOGGER.debug(
263
- "Handshake2 posted %s. Host is %s, Response status is %s, "
264
- + "Request was %s",
264
+ "Handshake2 posted %s. Host is %s, "
265
+ "Response status is %s, Request was %s",
265
266
  datetime.datetime.now(),
266
267
  self._host,
267
268
  response_status,
@@ -338,18 +339,17 @@ class KlapTransport(BaseTransport):
338
339
  + f"Response status is {response_status}, Request was {request}"
339
340
  )
340
341
  if response_status != 200:
341
- _LOGGER.error("Query failed after successful authentication " + msg)
342
+ _LOGGER.error("Query failed after successful authentication: %s", msg)
342
343
  # If we failed with a security error, force a new handshake next time.
343
344
  if response_status == 403:
344
345
  self._handshake_done = False
345
346
  raise _RetryableError(
346
- f"Got a security error from {self._host} after handshake "
347
- + "completed"
347
+ "Got a security error from %s after handshake completed", self._host
348
348
  )
349
349
  else:
350
350
  raise KasaException(
351
- f"Device {self._host} responded with {response_status} to"
352
- + f"request with seq {seq}"
351
+ f"Device {self._host} responded with {response_status} to "
352
+ f"request with seq {seq}"
353
353
  )
354
354
  else:
355
355
  _LOGGER.debug("Device %s query posted %s", self._host, msg)
@@ -51,10 +51,12 @@ class Color(SmartModule):
51
51
 
52
52
  return HSV(hue=h, saturation=s, value=v)
53
53
 
54
- def _raise_for_invalid_brightness(self, value: int):
54
+ def _raise_for_invalid_brightness(self, value):
55
55
  """Raise error on invalid brightness value."""
56
- if not isinstance(value, int) or not (1 <= value <= 100):
57
- raise ValueError(f"Invalid brightness value: {value} (valid range: 1-100%)")
56
+ if not isinstance(value, int):
57
+ raise TypeError("Brightness must be an integer")
58
+ if not (0 <= value <= 100):
59
+ raise ValueError(f"Invalid brightness value: {value} (valid range: 0-100%)")
58
60
 
59
61
  async def set_hsv(
60
62
  self,
@@ -73,10 +75,14 @@ class Color(SmartModule):
73
75
  :param int value: value in percentage [0, 100]
74
76
  :param int transition: transition in milliseconds.
75
77
  """
76
- if not isinstance(hue, int) or not (0 <= hue <= 360):
78
+ if not isinstance(hue, int):
79
+ raise TypeError("Hue must be an integer")
80
+ if not (0 <= hue <= 360):
77
81
  raise ValueError(f"Invalid hue value: {hue} (valid range: 0-360)")
78
82
 
79
- if not isinstance(saturation, int) or not (0 <= saturation <= 100):
83
+ if not isinstance(saturation, int):
84
+ raise TypeError("Saturation must be an integer")
85
+ if not (0 <= saturation <= 100):
80
86
  raise ValueError(
81
87
  f"Invalid saturation value: {saturation} (valid range: 0-100%)"
82
88
  )
@@ -6,13 +6,14 @@ import asyncio
6
6
  import logging
7
7
  from collections.abc import Coroutine
8
8
  from datetime import date
9
- from typing import TYPE_CHECKING, Any, Callable, Optional
9
+ from typing import TYPE_CHECKING, Callable, Optional
10
10
 
11
11
  # When support for cpython older than 3.11 is dropped
12
12
  # async_timeout can be replaced with asyncio.timeout
13
13
  from async_timeout import timeout as asyncio_timeout
14
14
  from pydantic.v1 import BaseModel, Field, validator
15
15
 
16
+ from ...exceptions import KasaException
16
17
  from ...feature import Feature
17
18
  from ..smartmodule import SmartModule, allow_update_after
18
19
 
@@ -70,6 +71,11 @@ class Firmware(SmartModule):
70
71
 
71
72
  def __init__(self, device: SmartDevice, module: str):
72
73
  super().__init__(device, module)
74
+ self._firmware_update_info: UpdateInfo | None = None
75
+
76
+ def _initialize_features(self):
77
+ """Initialize features."""
78
+ device = self._device
73
79
  if self.supported_version > 1:
74
80
  self._add_feature(
75
81
  Feature(
@@ -115,13 +121,34 @@ class Firmware(SmartModule):
115
121
  type=Feature.Type.Sensor,
116
122
  )
117
123
  )
124
+ self._add_feature(
125
+ Feature(
126
+ device,
127
+ id="check_latest_firmware",
128
+ name="Check latest firmware",
129
+ container=self,
130
+ attribute_setter="check_latest_firmware",
131
+ category=Feature.Category.Info,
132
+ type=Feature.Type.Action,
133
+ )
134
+ )
118
135
 
119
136
  def query(self) -> dict:
120
137
  """Query to execute during the update cycle."""
121
- req: dict[str, Any] = {"get_latest_fw": None}
122
138
  if self.supported_version > 1:
123
- req["get_auto_update_info"] = None
124
- return req
139
+ return {"get_auto_update_info": None}
140
+ return {}
141
+
142
+ async def check_latest_firmware(self) -> UpdateInfo | None:
143
+ """Check for the latest firmware for the device."""
144
+ try:
145
+ fw = await self.call("get_latest_fw")
146
+ self._firmware_update_info = UpdateInfo.parse_obj(fw["get_latest_fw"])
147
+ return self._firmware_update_info
148
+ except Exception:
149
+ _LOGGER.exception("Error getting latest firmware for %s:", self._device)
150
+ self._firmware_update_info = None
151
+ return None
125
152
 
126
153
  @property
127
154
  def current_firmware(self) -> str:
@@ -129,26 +156,23 @@ class Firmware(SmartModule):
129
156
  return self._device.hw_info["sw_ver"]
130
157
 
131
158
  @property
132
- def latest_firmware(self) -> str:
159
+ def latest_firmware(self) -> str | None:
133
160
  """Return the latest firmware version."""
134
- return self.firmware_update_info.version
161
+ if not self._firmware_update_info:
162
+ return None
163
+ return self._firmware_update_info.version
135
164
 
136
165
  @property
137
- def firmware_update_info(self):
166
+ def firmware_update_info(self) -> UpdateInfo | None:
138
167
  """Return latest firmware information."""
139
- if not self._device.is_cloud_connected or self._has_data_error():
140
- # Error in response, probably disconnected from the cloud.
141
- return UpdateInfo(type=0, need_to_upgrade=False)
142
-
143
- fw = self.data.get("get_latest_fw") or self.data
144
- return UpdateInfo.parse_obj(fw)
168
+ return self._firmware_update_info
145
169
 
146
170
  @property
147
171
  def update_available(self) -> bool | None:
148
172
  """Return True if update is available."""
149
- if not self._device.is_cloud_connected:
173
+ if not self._device.is_cloud_connected or not self._firmware_update_info:
150
174
  return None
151
- return self.firmware_update_info.update_available
175
+ return self._firmware_update_info.update_available
152
176
 
153
177
  async def get_update_state(self) -> DownloadState:
154
178
  """Return update state."""
@@ -161,11 +185,17 @@ class Firmware(SmartModule):
161
185
  self, progress_cb: Callable[[DownloadState], Coroutine] | None = None
162
186
  ):
163
187
  """Update the device firmware."""
188
+ if not self._firmware_update_info:
189
+ raise KasaException(
190
+ "You must call check_latest_firmware before calling update"
191
+ )
192
+ if not self.update_available:
193
+ raise KasaException("A new update must be available to call update")
164
194
  current_fw = self.current_firmware
165
195
  _LOGGER.info(
166
196
  "Going to upgrade from %s to %s",
167
197
  current_fw,
168
- self.firmware_update_info.version,
198
+ self._firmware_update_info.version,
169
199
  )
170
200
  await self.call("fw_download")
171
201
 
@@ -181,14 +211,14 @@ class Firmware(SmartModule):
181
211
  )
182
212
  continue
183
213
 
184
- _LOGGER.debug("Update state: %s" % state)
214
+ _LOGGER.debug("Update state: %s", state)
185
215
  if progress_cb is not None:
186
216
  asyncio.create_task(progress_cb(state))
187
217
 
188
218
  if state.status == 0:
189
219
  _LOGGER.info(
190
220
  "Update idle, hopefully updated to %s",
191
- self.firmware_update_info.version,
221
+ self._firmware_update_info.version,
192
222
  )
193
223
  break
194
224
  elif state.status == 2:
@@ -207,15 +237,12 @@ class Firmware(SmartModule):
207
237
  _LOGGER.warning("Unhandled state code: %s", state)
208
238
 
209
239
  @property
210
- def auto_update_enabled(self):
240
+ def auto_update_enabled(self) -> bool:
211
241
  """Return True if autoupdate is enabled."""
212
- return (
213
- "get_auto_update_info" in self.data
214
- and self.data["get_auto_update_info"]["enable"]
215
- )
242
+ return "enable" in self.data and self.data["enable"]
216
243
 
217
244
  @allow_update_after
218
245
  async def set_auto_update_enabled(self, enabled: bool):
219
246
  """Change autoupdate setting."""
220
- data = {**self.data["get_auto_update_info"], "enable": enabled}
247
+ data = {**self.data, "enable": enabled}
221
248
  await self.call("set_auto_update_info", data)
@@ -90,7 +90,7 @@ class LightEffect(SmartModule, SmartLightEffect):
90
90
  """
91
91
  if effect != self.LIGHT_EFFECTS_OFF and effect not in self._scenes_names_to_id:
92
92
  raise ValueError(
93
- f"Cannot set light effect to {effect}, possible values "
93
+ f"The effect {effect} is not a built in effect. Possible values "
94
94
  f"are: {self.LIGHT_EFFECTS_OFF} "
95
95
  f"{' '.join(self._scenes_names_to_id.keys())}"
96
96
  )
@@ -77,7 +77,7 @@ class SmartModule(Module):
77
77
 
78
78
  def __init_subclass__(cls, **kwargs):
79
79
  name = getattr(cls, "NAME", cls.__name__)
80
- _LOGGER.debug("Registering %s" % cls)
80
+ _LOGGER.debug("Registering %s", cls)
81
81
  cls.REGISTERED_MODULES[name] = cls
82
82
 
83
83
  def _set_error(self, err: Exception | None):
@@ -309,8 +309,9 @@ class SmartProtocol(BaseProtocol):
309
309
  # In case the device returns empty lists avoid infinite looping
310
310
  if not next_batch[response_list_name]:
311
311
  _LOGGER.error(
312
- f"Device {self._host} returned empty "
313
- + f"results list for method {method}"
312
+ "Device %s returned empty results list for method %s",
313
+ self._host,
314
+ method,
314
315
  )
315
316
  break
316
317
  response_result[response_list_name].extend(next_batch[response_list_name])
@@ -25,7 +25,7 @@ async def handle_turn_on(dev, turn_on):
25
25
  await dev.turn_off()
26
26
 
27
27
 
28
- @pytest.fixture
28
+ @pytest.fixture()
29
29
  def dummy_protocol():
30
30
  """Return a smart protocol instance with a mocking-ready dummy transport."""
31
31
 
@@ -75,7 +75,7 @@ new_discovery = parametrize_discovery(
75
75
  async def discovery_mock(request, mocker):
76
76
  """Mock discovery and patch protocol queries to use Fake protocols."""
77
77
  fixture_info: FixtureInfo = request.param
78
- yield patch_discovery({DISCOVERY_MOCK_IP: fixture_info}, mocker)
78
+ return patch_discovery({DISCOVERY_MOCK_IP: fixture_info}, mocker)
79
79
 
80
80
 
81
81
  def create_discovery_mock(ip: str, fixture_data: dict):
@@ -253,4 +253,4 @@ def unsupported_device_info(request, mocker):
253
253
 
254
254
  mocker.patch("kasa.discover._DiscoverProtocol.do_discover", mock_discover)
255
255
 
256
- yield discovery_data
256
+ return discovery_data