mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-22 16:46:29 +00:00
parent
b4d5aeb5d0
commit
699fcdafba
@ -19,8 +19,8 @@ def password_for_validating(password):
|
||||
for _ in range(100):
|
||||
password = hashlib.sha256(password.encode()).hexdigest()
|
||||
try:
|
||||
return sum(map(int, RE_DIGITS.findall(password)))
|
||||
except ValueError:
|
||||
return int(str(sum(map(int, RE_DIGITS.findall(password))))[0])
|
||||
except (ValueError, IndexError):
|
||||
return 0
|
||||
|
||||
|
||||
|
@ -29,7 +29,8 @@ SCHEMA_SNAPSHOT = vol.Schema({
|
||||
vol.Required(ATTR_TYPE): vol.In([SNAPSHOT_FULL, SNAPSHOT_PARTIAL]),
|
||||
vol.Required(ATTR_NAME): vol.Coerce(str),
|
||||
vol.Required(ATTR_DATE): vol.Coerce(str),
|
||||
vol.Inclusive(ATTR_PROTECTED, 'encrypted'): vol.Coerce(int),
|
||||
vol.Inclusive(ATTR_PROTECTED, 'encrypted'):
|
||||
vol.All(vol.Coerce(int), vol.Length(1)),
|
||||
vol.Inclusive(ATTR_CRYPTO, 'encrypted'): CRYPTO_AES128,
|
||||
vol.Optional(ATTR_HOMEASSISTANT, default=dict): vol.Schema({
|
||||
vol.Optional(ATTR_VERSION): vol.Coerce(str),
|
||||
|
Loading…
x
Reference in New Issue
Block a user