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

Error connecting to alarm #39

Closed javiermoro closed 2 years ago

javiermoro commented 2 years ago

Hi.

Upgrading from 1.0.0.0 to any of the following versions breaks for me the Alarm. I found this error in the log:

2022-02-16 12:33:54 WARNING (MainThread) [homeassistant.util.async_] Detected blocking call inside the event loop. This is causing stability issues. Please report issue to the custom component author for securitas doing blocking calls at custom_components/securitas/__init__.py, line 296: await self.hass.async_add_executor_job(sleep(1))
2022-02-16 12:33:55 ERROR (MainThread) [homeassistant.components.alarm_control_panel] Error while setting up securitas platform for alarm_control_panel
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/securitas/alarm_control_panel.py", line 65, in async_setup_entry
    current_state: CheckAlarmStatus = await client.update_overview(
  File "/config/custom_components/securitas/__init__.py", line 296, in update_overview
    await self.hass.async_add_executor_job(sleep(1))
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
2022-02-16 12:34:02 WARNING (SyncWorker_3) [homeassistant.helpers.service] Unable to find services.yaml for the securitas integration

Info for the Sentinel device its working. I can see the following entities:

image

Regards

DNKROZ commented 2 years ago

I'm also having the same problem.

Error while setting up securitas platform for alarm_control_panel
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/securitas/alarm_control_panel.py", line 65, in async_setup_entry
    current_state: CheckAlarmStatus = await client.update_overview(
  File "/config/custom_components/securitas/__init__.py", line 296, in update_overview
    await self.hass.async_add_executor_job(sleep(1))
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable

I'll try to downgrade to a previous version to verify this but right now it seems related (since I didn't have this bug prior last upgrade).

Regards.

EDIT: Downgraded to 1.0.0.0 and it starts up ok

EDIT2: Updated to last version 1.1.3.0 and it seems it does fix this issue although I'm getting errors with the reported state.

javiermoro commented 2 years ago

The problem is also fixed for me.

Thanks.