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

Fix P410M energy updates during reverse solar power flow by YouCanCallMeAl · Pull Request #1751 · python-kasa/python-kasa · GitHub

Repository navigation

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .json  (1) .md  (2) .py  (3) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion README.md
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
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ The following devices have been tested and confirmed as working. If your device

### Supported Tapo[^1] devices

- **Plugs**: P100, P105, P110, P110M, P115, P125M, P135, TP10, TP15
- **Plugs**: P100, P105, P110, P110M, P115, P125M, P135, P410M, TP10, TP15
- **Power Strips**: P210M, P300, P304M, P306, P316M, TP25
- **Wall Switches**: S210, S220, S500, S500D, S505, S505D, S515D, TS15
- **Bulbs**: L430C, L430P, L510B, L510E, L530B, L530E, L530EA, L535E, L630
Expand Down
2 changes: 2 additions & 0 deletions SUPPORTED.md
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
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ All Tapo devices require authentication.<br>Hub-Connected Devices may work acros
- **P135**
- Hardware: 1.0 (US) / Firmware: 1.0.5
- Hardware: 1.0 (US) / Firmware: 1.2.0
- **P410M**
- Hardware: 1.0 (EU) / Firmware: 1.4.4
- **TP10**
- Hardware: 1.0 (IT) / Firmware: 1.2.5
- **TP15**
Expand Down
6 changes: 5 additions & 1 deletion kasa/smart/modules/energy.py
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
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ def query(self) -> dict:
}
if self.supported_version > 1:
req["get_current_power"] = None
req["get_emeter_data"] = None
# P410M returns malformed JSON from get_emeter_data while
# reporting reverse/solar-export power. get_energy_usage
# provides signed milliwatt current_power instead.
if self._device.model != "P410M":
req["get_emeter_data"] = None
Comment on lines +76 to +80

Copy link
Copy Markdown
Member

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

Where does the invalid data break the handling? Instead of hardcoding a model (whose firmware might be updated later on to fix this), I would rather try to catch the error case in a generic way.

req["get_emeter_vgain_igain"] = None
return req

Expand Down
1 change: 1 addition & 0 deletions tests/device_fixtures.py
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
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"P110",
"P110M",
"P115",
"P410M",
"KP125M",
"EP25",
"P125M",
Expand Down
Loading
Loading

Back | FazBrowse Home | New Git URL