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

'str' object has no attribute 'operation_status' error started appearing today #110

Closed garybrowngeo closed 1 year ago

garybrowngeo commented 1 year ago

Integration has been working fine until today when I started getting the following error any ideas?: Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/securitas/alarm_control_panel.py:207 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 22:50:01 (1 occurrences) Last logged: 22:50:01

[139899728076784] 'str' object has no attribute 'operation_status' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1755, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1792, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 958, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call await result File "/config/custom_components/securitas/alarm_control_panel.py", line 321, in async_alarm_arm_home await self.set_arm_state("ARMDAY1") File "/config/custom_components/securitas/alarm_control_panel.py", line 207, in set_arm_state while arm_status.operation_status == "WAIT": AttributeError: 'str' object has no attribute 'operation_status'

guerrerotook commented 1 year ago

This is a temporal issue. When arming sometimes the API reply back with a message that you left a window open and can't arm. This is not a critical issue because it doesn't prevent you to arm or disarm in the future. Anyway I change the code to prevent this error in the future.

Thanks for reporting it!.