This commit is contained in:
John Arild Berentsen authored and GitHub committed 2017-05-19 13:40:26 +02:00
1 parent 7daa92249a
commit 5aa72562a7
2 files changed
+6 -5

No files matched your search

+3 -2
View File
@@ -141,9 +141,10 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
class_id=zwave.const.COMMAND_CLASS_USER_CODE).values():
if value.index != code_slot:
continue
if len(str(usercode)) > 4:
if len(str(usercode)) < 4:
_LOGGER.error("Invalid code provided: (%s) "
"usercode must %s or less digits",
"usercode must be atleast 4 and at most"
" %s digits",
usercode, len(value.data))
break
value.data = str(usercode)