nielsfaber / alarmo

Easy to use alarm system integration for Home Assistant
1.24k stars 117 forks source link

Unable to disarm Alarmo on Home Assistant 2024.6.0 beta #952

Closed krazos closed 1 month ago

krazos commented 1 month ago

Alarmo Version

v1.10.1

HA Version

2024.6.0b1

Bug description

After upgrading to core-2024.6.0b0, I am no longer able to disarm Alarmo directly or through a script or automation. See log entries below.

Steps to reproduce

Triggered automation/ran script that successfully disarmed Alarmo prior to core-2024.6.0b0. Also tried disarming Alarmo manually with code.

Relevant log output

Logger: homeassistant.components.automation.disarm_alarmo_********
Source: helpers/script.py:526
integration: Automation (documentation, issues)
First occurred: 5:30:00 AM (1 occurrences)
Last logged: 5:30:00 AM

Disarm Alarmo ********: Error executing script. Unexpected error for call_service at pos 1: AlarmoBaseEntity.async_alarm_disarm() takes 1 positional argument but 2 were given
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2741, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2784, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 969, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1041, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/alarm_control_panel/__init__.py", line 207, in async_handle_alarm_disarm
    await self.async_alarm_disarm(self.code_or_default_code(code))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: AlarmoBaseEntity.async_alarm_disarm() takes 1 positional argument but 2 were given
Logger: homeassistant.components.script.good_morning
Source: helpers/script.py:526
integration: Script (documentation, issues)
First occurred: 6:27:39 AM (1 occurrences)
Last logged: 6:27:39 AM

Good Morning: Error executing script. Unexpected error for call_service at pos 8: AlarmoBaseEntity.async_alarm_disarm() takes 1 positional argument but 2 were given
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2741, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2784, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 969, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1041, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/alarm_control_panel/__init__.py", line 207, in async_handle_alarm_disarm
    await self.async_alarm_disarm(self.code_or_default_code(code))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: AlarmoBaseEntity.async_alarm_disarm() takes 1 positional argument but 2 were given
TheZoker commented 1 month ago

I have a similar issue, but the logs are different:

Logger: custom_components.alarmo.alarm_control_panel
Quelle: custom_components/alarmo/alarm_control_panel.py:331
Integration: Alarmo ([Dokumentation](https://github.com/nielsfaber/alarmo), [Probleme](https://github.com/nielsfaber/alarmo/issues))
Erstmals aufgetreten: 09:56:06 (1 Vorkommnisse)
Zuletzt protokolliert: 09:56:06

Cannot go to state disarmed from state disarmed.

and

Logger: homeassistant.components.websocket_api.http.connection
Quelle: components/websocket_api/commands.py:239
Integration: Home Assistant WebSocket API ([Dokumentation](https://www.home-assistant.io/integrations/websocket_api), [Probleme](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
Erstmals aufgetreten: 11:29:54 (1 Vorkommnisse)
Zuletzt protokolliert: 11:29:54

[139817800467008] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/alarm_control_panel/__init__.py", line 175, in async_alarm_disarm
    await self.hass.async_add_executor_job(self.alarm_disarm, code)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/alarmo/alarm_control_panel.py", line 354, in alarm_disarm
    self.async_update_state(STATE_ALARM_DISARMED)
  File "/config/custom_components/alarmo/alarm_control_panel.py", line 599, in async_update_state
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1008, in async_write_ha_state
    self.hass.verify_event_loop_thread("async_write_ha_state")
  File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread
    frame.report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report
    _report_integration(what, integration_frame, level, error_if_integration)
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration
    raise RuntimeError(
RuntimeError: Detected that custom integration 'alarmo' calls async_write_ha_state from a thread at custom_components/alarmo/alarm_control_panel.py, line 599: self.async_write_ha_state(). Please report it to the author of the 'alarmo' custom integration.

and

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: AlarmControlPanelEntity.async_alarm_disarm() got an unexpected keyword argument 'context_id'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2741, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2784, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 969, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1033, in _handle_entity_call
    task = hass.async_run_hass_job(job)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 936, in async_run_hass_job
    hassjob.target(*args)
  File "/config/custom_components/alarmo/alarm_control_panel.py", line 315, in async_service_disarm_handler
    self.async_alarm_disarm(
TypeError: AlarmControlPanelEntity.async_alarm_disarm() got an unexpected keyword argument 'context_id'