-
-
Notifications
You must be signed in to change notification settings - Fork 101
Improve post_connect logic #392
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
Conversation
If post_connect always triggers a charger issue eg disconnect this may cause continuous reconnects
Codecov Report
@@ Coverage Diff @@
## main #392 +/- ##
==========================================
- Coverage 89.15% 89.00% -0.15%
==========================================
Files 10 10
Lines 1208 1210 +2
Branches 181 182 +1
==========================================
Hits 1077 1077
- Misses 70 71 +1
- Partials 61 62 +1
Continue to review full report at Codecov.
|
This reverts commit e240bff.
@@ -268,6 +268,8 @@ async def test_services(hass, socket_enabled): | |||
# use same id to ensure metrics populated | |||
cp = ChargePoint("CP_1_test", ws) | |||
cp.accept = False | |||
cs.charge_points[cs.cpid].received_boot_notification = False | |||
cs.charge_points[cs.cpid].post_connect_success = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lbbrhzn, not sure why these statements do not fully test the if statements above, any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the NotImplementedError is never thrown. Are you expecting that when not accepted?
The ifs are not fully covered because the first if is always true (smart profile) and the second if is always false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how the NotImplementedError should work, there is also the exceptions.py code which is not called during testing but references throwing an error configuring the charger.
If post_connect always triggers a charger issue eg disconnect this may cause continuous reconnects