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

if password has special characters, config flow fails #85

Closed javcon closed 8 months ago

javcon commented 2 years ago

Hi

there are two problems, related...

  1. if password has special character, it is not escaped. you can make it work enclosing the password in "" this is different from other integrations, where this is not needed (so issue has easy workaround)

  2. The auth failure is not handled properly, and the flow will end on error 500 after trying

  3. 2022-09-26 10:16:10.090 ERROR (MainThread) [custom_components.securitas.securitas_direct_new_api.apimanager] Lo sentimos. No se ha podido realizar la acción solicitada. 2022-09-26 10:16:10.091 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/securitas/alarm_control_panel.py", line 57, in async_setup_entry current_state: CheckAlarmStatus = await client.update_overview( File "/config/custom_components/securitas/init.py", line 398, in update_overview while alarm_status.operation_status == "WAIT": AttributeError: 'str' object has no attribute 'operation_status'

OkOtChA666 commented 2 years ago

Hi

there are two problems, related...

  1. if password has special character, it is not escaped. you can make it work enclosing the password in "" this is different from other integrations, where this is not needed (so issue has easy workaround)
  2. The auth failure is not handled properly, and the flow will end on error 500 after trying

2022-09-26 10:16:10.090 ERROR (MainThread) [custom_components.securitas.securitas_direct_new_api.apimanager] Lo sentimos. No se ha podido realizar la acción solicitada. 2022-09-26 10:16:10.091 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/securitas/alarm_control_panel.py", line 57, in async_setup_entry current_state: CheckAlarmStatus = await client.update_overview( File "/config/custom_components/securitas/init.py", line 398, in update_overview while alarm_status.operation_status == "WAIT": AttributeError: 'str' object has no attribute 'operation_status'

Same!

guerrerotook commented 2 years ago

Can you guys shared some of the special charater in your password? Not your password of course!

OkOtChA666 commented 2 years ago

Hello @guerrerotook . Sorry for the confusion. I have a "diferent" problem. My problem is that my user it's not an email but a number (fiscal number). Is it possible to change the code for int/str instead of just str?

cantupaz commented 8 months ago

This should not be an issue anymore (my user ID is also a number and it works). Reopen if needed.