Fix clearing codes on Schlage locks with user codes sizes other than 4#557
Fix clearing codes on Schlage locks with user codes sizes other than 4#557firstof9 merged 1 commit intoFutureTense:betafrom
Conversation
…ther than 4. Fixes #561
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## beta #557 +/- ##
==========================================
+ Coverage 80.86% 83.62% +2.75%
==========================================
Files 19 25 +6
Lines 2341 2711 +370
==========================================
+ Hits 1893 2267 +374
+ Misses 448 444 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks! |
|
Yeah, not a fan either. Also, just doing another look, while this does address the "0000" vs "000000" (or whatever else), I just noticed that function doesn't return False on failure. @raman325 I didn't look too much deeper into the providers refactor. Looking at the base class method signature, should this return False after that debug statement? |
|
The return is only used for logging it looks like. It looks like you changed the handler that checks whether the PIN was properly cleared, but it doesn't actually do anything as far as I can tell so I don't think this will resolve your issue. I put up a different PR that might be more effective: #558 I also fixed the returns |
Proposed change
Add logic to handle user code lengths other than 4, for Schlage locks that return ("0"*code_length) after clearing the user code.
I added a couple of tests as well. Could probably drop it to one test, and run through a few different lengths, but this seemed to at least test the core of the change.
Type of change
Additional information