architecture icon indicating copy to clipboard operation
architecture copied to clipboard

Alarm Control Panel: The code parameter to arm and disarm should differentiate whether a keypad is shown or not

Open davesmeghead opened this issue 4 years ago • 0 comments

Context

In the Alarm Control Panel Entity frontend, either a keypad (with text entry) is shown or not depending on a code_format property.

Current operation:

  • When a keypad is not shown: the code parameter is None
  • When a keypad is shown and the user selects a set of numbers: the code parameter entered as a string type e.g. "1234"
  • When a keypad is shown and the user does not select numbers: the code parameter is None

Proposal

Proposed operation:

  • First 2 points above, the same as current operation
  • When a keypad is shown and the user does not select numbers: the code parameter is an empty string ""

This latter case can be used by the backend, it knows that a keypad was shown to the user but no code was entered.

Consequences

It prevents the backend having to know whether a code was asked for. Many of the current "alarm_control_panel" Entity integrations ignore the code parameter but some use it. This is mainly a change in the frontend but the backend integrations would need to be checked.

davesmeghead avatar Nov 13 '20 16:11 davesmeghead