mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Drop deepcopy of manual mqtt alarm control panel config (#89287)
This commit is contained in:
parent
ff2a88b426
commit
3f061e9101
@ -1,7 +1,6 @@
|
|||||||
"""Support for manual alarms controllable via MQTT."""
|
"""Support for manual alarms controllable via MQTT."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import copy
|
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
@ -87,15 +86,18 @@ ATTR_POST_PENDING_STATE = "post_pending_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_PENDING_STATES:
|
for state in SUPPORTED_PENDING_STATES:
|
||||||
if CONF_PENDING_TIME not in config[state]:
|
if CONF_PENDING_TIME not in config[state]:
|
||||||
config[state][CONF_PENDING_TIME] = config[CONF_PENDING_TIME]
|
config[state] = config[state] | {
|
||||||
|
CONF_PENDING_TIME: config[CONF_PENDING_TIME]
|
||||||
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user