Skip to content

[Bug]: alarm_control_panel.py, code_format aways returns CodeFormat.TEXT #413

@somm15

Description

@somm15

Describe the bug

The function code_format tests self._code uses a regex to determine if it's a number or a text.
The code used it the one associated to the user configured in homeassistant (visual interface code).
However, I don't believe that the actual code is ever returned by the API (that would be strange, I suppose that the validation is done on the miniserver).
The funciton code_arm_required initializes self._code to "required".
The regex is not applied on the code but on the string required (or None if the block is not secured).

I don't have any good idea about how to solve that.
I don't think that Loxone can enforce numbers for the code (but I did not careful studied the API).
However, having code_format as NUMBER can be quite useful. Some devices like the "NSPanel" only support alarms with NUMBERS, not TEXT.

I used debug logs that the comparison is done on the string "required".

Firmware of your Miniserver

16.0.6.10

HomeAssistant install method

docker

Version of HomeAssistant

2025.07

Version of Pyloxone

See HA 2025.07

Update pyloxone

latest

Log

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions