guerrerotook / securitas-direct-new-api

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

Bug: Error when activating/deactivating alarm #163

Closed sh4rks closed 7 months ago

sh4rks commented 10 months ago

I’m unable to activate/ deactivate alarm with the code .

find below the error log:

Logger: homeassistant.helpers.entity Source: helpers/entity.py:732 First occurred: 17:57:25 (12 occurrences) Last logged: 18:49:40

Update for alarm_control_panel.alarme_maison_v fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 732, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 991, in async_device_update await self.async_update() File "/config/custom_components/securitas/alarm_control_panel.py", line 305, in async_update alarm_status: CheckAlarmStatus = await self.client.update_overview( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/securitas/init.py", line 406, in update_overview alarm_status = await self.session.check_alarm_status( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/securitas/securitas_direct_new_api/apimanager.py", line 486, in check_alarm_status response: ClientResponse = await self._execute_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/securitas/securitas_direct_new_api/apimanager.py", line 127, in _execute_request error_login: bool = await self._check_errros(response_text) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/securitas/securitas_direct_new_api/apimanager.py", line 149, in _check_errros response = json.loads(value) ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

cantupaz commented 7 months ago

this was fixed in recent versions of the integration. Closing as fixed.