gh #192 updated the tapo multi power switch changes#194
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the tapoControl module to support newer Tapo devices and improves the code quality through better null checking and consistent state management. The changes include upgrading dependencies to support new API versions and refactoring power control logic.
- Updated numpy to version >=2.0.0,<2.3.0 and python-kasa to 0.7.7 to support newer device features
- Refactored outlet/state checking to use explicit
is not Nonecomparisons instead of truthy checks - Replaced property accessors (
is_on/is_off) with direct_is_onattribute usage for consistency - Enhanced power monitoring to support multi-outlet devices with updated API calls
Reviewed Changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| requirements.txt | Updated numpy, python-kasa, and typing_extensions to newer versions |
| framework/core/powerModules/tapoControl.py | Refactored state management, outlet checking, added support for Children device type, and updated power monitoring implementation |
Comments suppressed due to low confidence (2)
framework/core/powerModules/tapoControl.py:187
- The
_performCommandmethod doesn't accept anoArgsparameter. According to the method signature at line 84, it only acceptscommand,json, andappend_argsparameters. This will cause a TypeError at runtime.
result = self._performCommand("state", noArgs=True)
framework/core/powerModules/tapoControl.py:203
- The attribute
self.slotIndexis referenced but never defined in the class. This will raise an AttributeError at runtime. It appears this should beint(self._outlet)based on the outlet handling elsewhere in the code.
if powerState[self.slotIndex+1] == "OFF":
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
TB-1993
requested changes
Nov 6, 2025
Contributor
TB-1993
left a comment
There was a problem hiding this comment.
most of the copilot suggestions are good too
Anbukannadhasan
commented
Nov 10, 2025
Contributor
Author
Anbukannadhasan
left a comment
There was a problem hiding this comment.
Addressed review comments
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.