Skip to content

Commit e075a76

Browse files
committed
fix #142: Cannot arm alarm with version 0.29 when no code is required for arming
* when the JA-82K control panel doesn't require a code for arming and the panel is configured in unsplit mode the arming must be done by simulating a keypad press on the ABC button; sending an empty code has no effect
1 parent b7e9d58 commit e075a76

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

custom_components/jablotron80/alarm_control_panel.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,17 @@ async def async_alarm_arm_home(self, code=None) -> None:
137137
async def async_alarm_arm_away(self, code=None) -> None:
138138
if not self._cu.is_code_required_for_arm():
139139
code = ""
140-
elif not self.code_arm_required :
140+
elif not self.code_arm_required :
141141
code = self._cu._master_code
142142
if code == None:
143143
return
144144
if self._cu.mode == JA80CentralUnit.SYSTEM_MODE_UNSPLIT:
145-
# just one zone so input code without any "kinks"
146-
self._cu.arm(code)
145+
# if we have received a code use it to arm the system
146+
if len(code) > 0:
147+
self._cu.arm(code)
148+
# otherwise simulate an ABC key press (zone C means all zones)
149+
else:
150+
self._cu.arm(code, "C")
147151
elif self._cu.mode in [JA80CentralUnit.SYSTEM_MODE_PARTIAL,JA80CentralUnit.SYSTEM_MODE_SPLIT]:
148152
self._cu.arm(code,"C")
149153

0 commit comments

Comments
 (0)