filmkorn / pyanova-nano

Control the Anova Nano via BLE.
Apache License 2.0
3 stars 0 forks source link

bleak_esphome backend: BleakClient.start_notify called when already subscribed raises error #11

Closed filmkorn closed 1 month ago

filmkorn commented 1 month ago
Traceback (most recent call last):
File "/config/custom_components/anova_nano/coordinator.py", line 140, in _async_update_data
self.status = await self.client.get_sensor_values()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyanova_nano/client.py", line 455, in get_sensor_values
sensor_value_list = await self.send_read_command(ReadCommands.GetSensorValues)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyanova_nano/client.py", line 281, in send_read_command
return await self.send_command(command=command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyanova_nano/client.py", line 347, in send_command
await get_data()
File "/usr/local/lib/python3.12/site-packages/pyanova_nano/client.py", line 336, in get_data
await self._client.start_notify(
File "/usr/local/lib/python3.12/site-packages/bleak/__init__.py", line 844, in start_notify
await self._backend.start_notify(characteristic, wrapped_callback, **kwargs)
File "/usr/local/lib/python3.12/site-packages/bleak_esphome/backend/client.py", line 77, in _async_wrap_bluetooth_operation
return await func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/bleak_esphome/backend/client.py", line 646, in start_notify
raise BleakError(
bleak.exc.BleakError: esp32-01-b24244 [B8:D6:1A:B2:42:44]: Nano - 58:93:D8:D8:7D:A4: Notifications are already enabled on service:0e140000-0af1-4582-a242-773e63054c68 characteristic:0e140002-0af1-4582-a242-773e63054c68 handle:14