GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — Use stacklevel=2 for warnings to report on callsites by rytilahti · Pull Request #1219 · python-kasa/python-kasa Conversation
Member
Use stacklevel=2 for warnings, as this will correctly show the callsite instead of the line where the warning is reported. Currently: After: Currently: After:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## master #1219 +/- ## ======================================= Coverage 92.48% 92.48% ======================================= Files 99 99 Lines 6535 6535 Branches 700 700 ======================================= Hits 6044 6044 Misses 374 374 Partials 117 117 ☔ View full report in Codecov by Sentry. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This makes sense when the warning is coming from |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think it makes sense there, too: vs. and vs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ok cool, let's merge. N.B. Once all the ANN changes are in we might want to consider putting all the deprecated __getattr__ behind if not TYPE_CHECKING:
Sorry, something went wrong.
There was an error while loading. Please reload this page.
## [0.7.7](https://github.com/python-kasa/python-kasa/tree/0.7.7) (2024-11-04) [Full Changelog](0.7.6...0.7.7) **Release summary:** - Bugfix for child device device creation error with credentials_hash - PIR support for iot dimmers and wall switches. - Various small enhancements and project improvements. **Implemented enhancements:** - Add PIR&LAS for wall switches mentioning PIR support [\#1227](#1227) (@rytilahti) - Expose ambient light setting for iot dimmers [\#1210](#1210) (@rytilahti) - Expose PIR enabled setting for iot dimmers [\#1174](#1174) (@rytilahti) - Add childprotection module [\#1141](#1141) (@rytilahti) - Initial trigger logs implementation [\#900](#900) (@rytilahti) **Fixed bugs:** - Fix AES child device creation error [\#1220](#1220) (@sdb9696) **Project maintenance:** - Update TC65 fixture [\#1225](#1225) (@rytilahti) - Update smartcamera fixtures from latest dump\_devinfo [\#1224](#1224) (@sdb9696) - Add component queries to smartcamera devices [\#1223](#1223) (@sdb9696) - Update try\_connect\_all to be more efficient and report attempts [\#1222](#1222) (@sdb9696) - Use stacklevel=2 for warnings to report on callsites [\#1219](#1219) (@rytilahti) - parse\_pcap\_klap: various code cleanups [\#1138](#1138) (@rytilahti)
Use stacklevel=2 for warnings, as this will correctly show the callsite
instead of the line where the warning is reported.
Currently:
```
kasa/__init__.py:110
/home/tpr/code/python-kasa/kasa/__init__.py:110: DeprecationWarning: SmartDevice is deprecated, use IotDevice from package kasa.iot instead or use Discover.discover_single() and Device.connect() to support new protocols
warn(
```
After:
```
kasa/tests/smart/modules/test_contact.py:3
/home/tpr/code/python-kasa/kasa/tests/smart/modules/test_contact.py:3: DeprecationWarning: SmartDevice is deprecated, use IotDevice from package kasa.iot instead or use Discover.discover_single() and Device.connect() to support new protocols
from kasa import Module, SmartDevice
```
Currently:
```
kasa/tests/test_lightstrip.py: 56 warnings
/home/tpr/code/python-kasa/kasa/device.py:559: DeprecationWarning: effect is deprecated, use: Module.LightEffect in device.modules instead
warn(msg, DeprecationWarning, stacklevel=1)
```
After:
```
kasa/tests/test_lightstrip.py::test_effects_lightstrip_set_effect_transition[500-KL430(US)_2.0_1.0.9.json]
/home/tpr/code/python-kasa/kasa/tests/test_lightstrip.py:62: DeprecationWarning: set_effect is deprecated, use: Module.LightEffect in device.modules instead
await dev.set_effect("Candy Cane")
```
## [0.7.7](https://github.com/python-kasa/python-kasa/tree/0.7.7) (2024-11-04) [Full Changelog](python-kasa/python-kasa@0.7.6...0.7.7) **Release summary:** - Bugfix for child device device creation error with credentials_hash - PIR support for iot dimmers and wall switches. - Various small enhancements and project improvements. **Implemented enhancements:** - Add PIR&LAS for wall switches mentioning PIR support [\python-kasa#1227](python-kasa#1227) (@rytilahti) - Expose ambient light setting for iot dimmers [\python-kasa#1210](python-kasa#1210) (@rytilahti) - Expose PIR enabled setting for iot dimmers [\python-kasa#1174](python-kasa#1174) (@rytilahti) - Add childprotection module [\python-kasa#1141](python-kasa#1141) (@rytilahti) - Initial trigger logs implementation [\python-kasa#900](python-kasa#900) (@rytilahti) **Fixed bugs:** - Fix AES child device creation error [\python-kasa#1220](python-kasa#1220) (@sdb9696) **Project maintenance:** - Update TC65 fixture [\python-kasa#1225](python-kasa#1225) (@rytilahti) - Update smartcamera fixtures from latest dump\_devinfo [\python-kasa#1224](python-kasa#1224) (@sdb9696) - Add component queries to smartcamera devices [\python-kasa#1223](python-kasa#1223) (@sdb9696) - Update try\_connect\_all to be more efficient and report attempts [\python-kasa#1222](python-kasa#1222) (@sdb9696) - Use stacklevel=2 for warnings to report on callsites [\python-kasa#1219](python-kasa#1219) (@rytilahti) - parse\_pcap\_klap: various code cleanups [\python-kasa#1138](python-kasa#1138) (@rytilahti)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.