FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add PIR&LAS for wall switches mentioning PIR support by rytilahti · Pull Request #1227 · python-kasa/python-kasa · GitHub

Repository navigation

Add PIR&LAS for wall switches mentioning PIR support - #1227

Merged
rytilahti merged 4 commits into
masterfrom
fix/enable_motion_ambient_for_wallswitches
Nov 3, 2024
Merged

rytilahti merged 4 commits into
masterfrom
fix/enable_motion_ambient_for_wallswitches

Conversation

Copy link
Copy Markdown
Member

Some devices (like KS200M) support ambient and motion, but as they are detected as wall switches, they don't get the modules added.
This PR enables the respective modules for wall switches when the dev_name contains PIR.

Fixes #1226

rytilahti added the enhancement New feature or request label Nov 3, 2024

codecov Bot commented Nov 3, 2024 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.57%. Comparing base (54f0e91) to head (56abd8e).
Report is 207 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1227      +/-   ##
==========================================
- Coverage   92.60%   92.57%   -0.03%     
==========================================
  Files          99      101       +2     
  Lines        6558     6629      +71     
  Branches      703      709       +6     
==========================================
+ Hits         6073     6137      +64     
- Misses        364      370       +6     
- Partials      121      122       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

sdb9696 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Great PR!

Copy link
Copy Markdown
Member Author

I'll add a test for this behavior after receiving a confirmation, that it works as expected.

Comment thread kasa/tests/iot/test_wallswitch.py Outdated

Copy link
Copy Markdown

Genius!! It works as expected when using in a script by getting the "pir_enabled" feature. It also now shows on the modules list. I'm now able to toggle the switches PIR :)

Not that I need it, but it doesn't work using the cli kasa command, it still shows "no feature by name 'pir_enabled'".

rytilahti commented Nov 3, 2024 •
edited
Loading

Copy link
Copy Markdown
Member Author

Thanks for reporting back!

Do you see the feature (and the modules) listed in the status output of the cli tool? If you use --debug, do you see the PIR responses in the logs?

We obviously want to fix that, but it can be done in a separate PR, so let's merge this already.

rytilahti merged commit b2f3971 into master Nov 3, 2024
rytilahti deleted the fix/enable_motion_ambient_for_wallswitches branch November 3, 2024 15:45

eternalliving commented Nov 3, 2024 •
edited
Loading

Copy link
Copy Markdown

I don't see the PIR or ambient features or modules when using the cli tool:
kasa --host xxx

Edit: I needed to run uv run kasa as I was trying to use the pip version that didn't have the changes applied. All is working as expected.

sdb9696 added this to the 0.7.7 milestone Nov 4, 2024
sdb9696 mentioned this pull request Nov 4, 2024
sdb9696 added a commit that referenced this pull request Nov 4, 2024
## [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)
pillarsdotnet pushed a commit to pillarsdotnet/python-kasa that referenced this pull request Oct 22, 2026
Some devices (like KS200M) support ambient and motion, but as they are
detected as wall switches, they don't get the modules added.
This PR enables the respective modules for wall switches when the
`dev_name` contains `PIR`.
pillarsdotnet pushed a commit to pillarsdotnet/python-kasa that referenced this pull request Oct 22, 2026
## [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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KS200M doesn't show PIR feature or module

3 participants


Back | FazBrowse Home | New Git URL