mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Drop deepcopy of manual alarm control panel config (#89286)
This commit is contained in:
parent
3f061e9101
commit
f48b535d9d
@ -1,7 +1,6 @@
|
|||||||
"""Support for manual alarms."""
|
"""Support for manual alarms."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import copy
|
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
@ -74,15 +73,16 @@ ATTR_NEXT_STATE = "next_state"
|
|||||||
|
|
||||||
def _state_validator(config):
|
def _state_validator(config):
|
||||||
"""Validate the state."""
|
"""Validate the state."""
|
||||||
config = copy.deepcopy(config)
|
|
||||||
for state in SUPPORTED_PRETRIGGER_STATES:
|
for state in SUPPORTED_PRETRIGGER_STATES:
|
||||||
if CONF_DELAY_TIME not in config[state]:
|
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]:
|
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:
|
for state in SUPPORTED_ARMING_STATES:
|
||||||
if CONF_ARMING_TIME not in config[state]:
|
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
|
return config
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user