core: yalexs_ble - Cipher not set

The problem

Getting an unexpected error when attempting to add Yale YRL216-NR-619 Assure Level either manually via key/slot or when attempting to import from august integration.

What version of Home Assistant Core has the issue?

2023.1.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

yalexs_ble

Link to integration documentation on our website

https://www.home-assistant.io/integrations/yalexs_ble/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-01-18 13:22:58.364 ERROR (MainThread) [homeassistant.components.yalexs_ble.config_flow] Unexpected error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/yalexs_ble/config_flow.py", line 187, in async_step_user
    await validate_lock(local_name, discovery_info.device, key, slot)
  File "/usr/src/homeassistant/homeassistant/components/yalexs_ble/config_flow.py", line 46, in validate_lock
    await PushLock(local_name, device.address, device, key, slot).validate()
  File "/usr/local/lib/python3.10/site-packages/yalexs_ble/push.py", line 479, in validate
    await self._update()
  File "/usr/local/lib/python3.10/site-packages/yalexs_ble/push.py", line 77, in _async_wrap_operation_lock
    return await func(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/yalexs_ble/push.py", line 98, in _async_wrap_retry_bluetooth_connection_error
    return await func(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/yalexs_ble/push.py", line 495, in _update
    state = await lock.status()
  File "/usr/local/lib/python3.10/site-packages/yalexs_ble/lock.py", line 298, in status
    response = await self._execute_command(
  File "/usr/local/lib/python3.10/site-packages/yalexs_ble/lock.py", line 271, in _execute_command
    response = await self.session.execute(
  File "/usr/local/lib/python3.10/site-packages/yalexs_ble/session.py", line 222, in execute
    return await write_task
  File "/usr/local/lib/python3.10/site-packages/yalexs_ble/session.py", line 105, in _write
    return await self._locked_write(command)
  File "/usr/local/lib/python3.10/site-packages/yalexs_ble/session.py", line 139, in _locked_write
    assert self.cipher_encrypt is not None, "Cipher not set"  # nosec
AssertionError: Cipher not set

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I also modified the library to strip off the null bytes for the ASL-02 so it should detect it correctly now

Looks like it disconnects just at the wrong time which clears the cipher and that the task moves forward after the cipher is already cleared not expecting that the lock has disconnected out from under it.