Enable AlarmDecoder arming without security code (#32390)
* set alarmdecoder code_arm_required to False * rm unnecessary f strings * add code_arm_required config option * add self as codeowner :-) * add self as codeowner the right way
This commit is contained in:
1 parent
f4b3760a1a
commit
40356b4fc5
4 files changed
+41
-12
No files matched your search
@@ -33,6 +33,7 @@ CONF_ZONE_RFID = "rfid"
|
||||
CONF_ZONES = "zones"
|
||||
CONF_RELAY_ADDR = "relayaddr"
|
||||
CONF_RELAY_CHAN = "relaychan"
|
||||
CONF_CODE_ARM_REQUIRED = "code_arm_required"
|
||||
|
||||
DEFAULT_DEVICE_TYPE = "socket"
|
||||
DEFAULT_DEVICE_HOST = "localhost"
|
||||
@@ -42,6 +43,7 @@ DEFAULT_DEVICE_BAUD = 115200
|
||||
|
||||
DEFAULT_AUTO_BYPASS = False
|
||||
DEFAULT_PANEL_DISPLAY = False
|
||||
DEFAULT_CODE_ARM_REQUIRED = True
|
||||
|
||||
DEFAULT_ZONE_TYPE = "opening"
|
||||
|
||||
@@ -105,6 +107,9 @@ CONFIG_SCHEMA = vol.Schema(
|
||||
CONF_PANEL_DISPLAY, default=DEFAULT_PANEL_DISPLAY
|
||||
): cv.boolean,
|
||||
vol.Optional(CONF_AUTO_BYPASS, default=DEFAULT_AUTO_BYPASS): cv.boolean,
|
||||
vol.Optional(
|
||||
CONF_CODE_ARM_REQUIRED, default=DEFAULT_CODE_ARM_REQUIRED
|
||||
): cv.boolean,
|
||||
vol.Optional(CONF_ZONES): {vol.Coerce(int): ZONE_SCHEMA},
|
||||
}
|
||||
)
|
||||
@@ -121,6 +126,7 @@ def setup(hass, config):
|
||||
device = conf[CONF_DEVICE]
|
||||
display = conf[CONF_PANEL_DISPLAY]
|
||||
auto_bypass = conf[CONF_AUTO_BYPASS]
|
||||
code_arm_required = conf[CONF_CODE_ARM_REQUIRED]
|
||||
zones = conf.get(CONF_ZONES)
|
||||
|
||||
device_type = device[CONF_DEVICE_TYPE]
|
||||
@@ -206,7 +212,11 @@ def setup(hass, config):
|
||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_alarmdecoder)
|
||||
|
||||
load_platform(
|
||||
hass, "alarm_control_panel", DOMAIN, {CONF_AUTO_BYPASS: auto_bypass}, config
|
||||
hass,
|
||||
"alarm_control_panel",
|
||||
DOMAIN,
|
||||
{CONF_AUTO_BYPASS: auto_bypass, CONF_CODE_ARM_REQUIRED: code_arm_required},
|
||||
config,
|
||||
)
|
||||
|
||||
if zones:
|
||||
|
||||
Reference in new issue
Block a user