Drop deepcopy of manual alarm control panel config (#89286)

pull/89302/head
Erik Montnemery 2023-03-07 16:15:48 +01:00 committed by GitHub
parent 3f061e9101
commit f48b535d9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -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