Drop deepcopy of manual alarm control panel config (#89286)
parent
3f061e9101
commit
f48b535d9d
|
@ -1,7 +1,6 @@
|
|||
"""Support for manual alarms."""
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import datetime
|
||||
import logging
|
||||
import re
|
||||
|
@ -74,15 +73,16 @@ ATTR_NEXT_STATE = "next_state"
|
|||
|
||||
def _state_validator(config):
|
||||
"""Validate the state."""
|
||||
config = copy.deepcopy(config)
|
||||
for state in SUPPORTED_PRETRIGGER_STATES:
|
||||
if CONF_DELAY_TIME not in config[state]:
|
||||
config[state][CONF_DELAY_TIME] = config[CONF_DELAY_TIME]
|
||||
config[state] = config[state] | {CONF_DELAY_TIME: config[CONF_DELAY_TIME]}
|
||||
if CONF_TRIGGER_TIME not in config[state]:
|
||||
config[state][CONF_TRIGGER_TIME] = config[CONF_TRIGGER_TIME]
|
||||
config[state] = config[state] | {
|
||||
CONF_TRIGGER_TIME: config[CONF_TRIGGER_TIME]
|
||||
}
|
||||
for state in SUPPORTED_ARMING_STATES:
|
||||
if CONF_ARMING_TIME not in config[state]:
|
||||
config[state][CONF_ARMING_TIME] = config[CONF_ARMING_TIME]
|
||||
config[state] = config[state] | {CONF_ARMING_TIME: config[CONF_ARMING_TIME]}
|
||||
|
||||
return config
|
||||
|
||||
|
|
Loading…
Reference in New Issue