Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix instantaneous demand on Schneider Wiser outlets #2836

Merged
merged 4 commits into from
Jan 29, 2024

Conversation

kosmiq
Copy link
Contributor

@kosmiq kosmiq commented Dec 13, 2023

Based on the code supplied by krlssn in comment #1889 (comment)

I'm VERY new to the whole Python world so I feel totally lost when it comes to writing tests and honestly not capable of doing so currently. I'm currently trying to get a dev env setup with Python 3.12 but I get weird errors regarding building wheels and whatnot. I'll see if I can get that running...

Proposed change

  • Add quirks for Schneider Wiser outlets and how metering is calculated

Additional information

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works

Based on the code supplied by krlssn in comment zigpy#1889 (comment)
tweaked output clusters
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a0c4109) 87.37% compared to head (65b4f4d) 87.58%.
Report is 20 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2836      +/-   ##
==========================================
+ Coverage   87.37%   87.58%   +0.20%     
==========================================
  Files         287      295       +8     
  Lines        8848     9013     +165     
==========================================
+ Hits         7731     7894     +163     
- Misses       1117     1119       +2     

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

@kosmiq
Copy link
Contributor Author

kosmiq commented Dec 13, 2023

Also I would love some guidance on how I can test this on my HA Green that I'm running. Do I compile and upload as a custom component? I'd rather not screw it up since it works wonderfully at the moment, except for this little pesky thing with how numbers are reported :)

@alrassia
Copy link
Contributor

Also I would love some guidance on how I can test this on my HA Green that I'm running. Do I compile and upload as a custom component? I'd rather not screw it up since it works wonderfully at the moment, except for this little pesky thing with how numbers are reported :)

You can take a look at https://community.home-assistant.io/t/how-to-setup-local-zha-quirks/341226 on how to setup using a custom quirk.

@Hedda
Copy link
Contributor

Hedda commented Dec 20, 2023

Also I would love some guidance on how I can test this on my HA Green that I'm running.

You can take a look at https://community.home-assistant.io/t/how-to-setup-local-zha-quirks/341226 on how to setup using a custom quirk.

Also check out this PR with an end-user how-to guide for the readme -> #2419 + this other discussion here -> #2467

@TheJulianJES TheJulianJES changed the title Added quirk for Schneider Wiser outlets Add quirk for Schneider Wiser outlets Jan 19, 2024
@TheJulianJES TheJulianJES added the new quirk Adds support for a new device label Jan 19, 2024
@TheJulianJES
Copy link
Collaborator

@kosmiq Were you able to get this running and verify that it works for your plugs (by installing the file as a custom quirk)?

@TheJulianJES TheJulianJES changed the title Add quirk for Schneider Wiser outlets Fix instantaneous demand on Schneider Wiser outlets Jan 19, 2024
@TheJulianJES
Copy link
Collaborator

Pushed some small changes. This can be tested as a custom quirk using this: #1889 (comment)

@TheJulianJES TheJulianJES self-assigned this Jan 19, 2024
@kosmiq
Copy link
Contributor Author

kosmiq commented Jan 19, 2024

@kosmiq Were you able to get this running and verify that it works for your plugs (by installing the file as a custom quirk)?

Hi! Not yet. It’s on my radar but life got in the way with Christmas and all. Still looking to find the time.

Thanks for the cleanup and adding the tests! Much appreciated

@Hedda Hedda mentioned this pull request Jan 23, 2024
4 tasks
@TheJulianJES
Copy link
Collaborator

Tested here: #1889 (comment)

So, should be fine. Tests are also added.

@TheJulianJES TheJulianJES merged commit e40f71a into zigpy:dev Jan 29, 2024
14 checks passed
@kosmiq kosmiq deleted the schneider-wiser branch January 29, 2024 01:06
lgraf pushed a commit to lgraf/zha-device-handlers that referenced this pull request May 6, 2024
Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new quirk Adds support for a new device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants