-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add Peak Shaving work mode for H3 Inverters & H1 (Gen 2) #737
Conversation
If anyone can assist with this - This is for a small change to the workmode select for the H1_G2 and H3_SET it has been tested in operation ok but when doing the PR all of the tests are ok with the exception of pytest on the Inv.H3 - when I run a pytest --snapshot-update it fails with this error (as if the test script itself is breaking) but only on the Inv.H3 ? FAILED tests/test_entity_descriptions.py::test_entity_descriptions_for_model[Inv.H3] - RuntimeError: dictionary keys changed during iteration |
…nging keys during iteration added copy() to avoid the iteration changing the desired dict The snapshot tests now run correctly
To avoid the runtime error i've had to make a change in test_entity_descriptions.py, the pytest snapshot now works correctly and the output in the inverter model tests is correct. |
correctly updated snapshot
correctly updated snapshots
@canton7 Hi Antony would you please review this change - i've had a load of problems for what was only a minor change to the workmode select for the H3_SET to add 'Peak Shaving', and the pytest snapshots start to fail with a RuntimeError: dictionary keys changed during iteration. When I looked more closely at the content of the existing tests I found that with work_mode select the test results were random and in the case of the H3_Pro incorrectly showing only 2 of the options - in the case of the Inv.H3 the snapshot crashed with the above error. I've had to make a change in |
Good catch on the test! Thanks, looks good. |
Adds the Peak Shaving work mode in the select for H3 set Inverters & H1 (Gen 2)
See #699