Secure arming & codes with leading zeros #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My Qolsys panel has secure arming enabled which requires the input of the user code to arm the panel. This can be enabled through Dealer Settings > Security & Arming. With this change it might make sense to change the YAML variable "qolsys_disarm_code" to "qolsys_usercode" but I leave that up to the community.
I also tested my alarm after disabling Secure Arming and it doesn't seem to mind receiving the usercode if it's isn't required so this shouldn't effect people who don't have it enabled.
I've also adjusted the usercode to be stored as a string instead of integer so codes that start with leading zeros don't get shortened. For example:
str(int(0050)) == '50'