guerrerotook / securitas-direct-new-api

This repository contains the new securitas direct API that can be integrated in Home Assistant
Apache License 2.0
79 stars 30 forks source link

Unable to activate or deactivate alarm - Key error "enable_code" #169

Closed sky-luke closed 11 months ago

sky-luke commented 11 months ago

After updating to version v2.4.0.3 i am unable to control the alarm. Here are the logs. Country FR

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:230
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 18:38:06 (1 occurrences)
Last logged: 18:38:06

[548284696000] 'enable_code'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 230, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/securitas/alarm_control_panel.py", line 342, in async_alarm_arm_home
    if self.check_code(code):
       ^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/securitas/alarm_control_panel.py", line 329, in check_code
    if not self.client.config_entry.data[CONF_ENABLE_CODE]:
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'enable_code'
ToroNander commented 11 months ago

Same here, Country ES.

BR

miquellaboria commented 11 months ago

Same here, and when try to reconfigure shows an 500 error: 500 Internal Server Error Server got itself in trouble

ToroNander commented 11 months ago

I switched back to V2.3.0.0 and it works fine again.

Core 2023.11.2 Supervisor 2023.11.0 Operating System 11.1 Frontend 20231030.2

guerrerotook commented 11 months ago

Solved in the last commit, let me create a new release.