ble_monitor: [Bug]: Binary sensors don't work correctly after update to 12.6.0 and above

What happened?

After version 12.5.1 any binary sensor doesn’t work Screenshot_2024-01-09-20-30-04-227_io homeassistant companion android

Sensor type

Binary sensor

Relevant log output

Эта ошибка возникла в пользовательской интеграции.

Logger: homeassistant
Source: custom_components/ble_monitor/binary_sensor.py:105
Integration: Passive BLE monitor (documentation, issues)
First occurred: 20:23:38 (1 occurrences)
Last logged: 20:23:38

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/ble_monitor/binary_sensor.py", line 157, in async_run
    sensors = await async_add_binary_sensor(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ble_monitor/binary_sensor.py", line 105, in async_add_binary_sensor
    entity_description = [item for item in BINARY_SENSOR_TYPES if item.key is measurement][0]
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Reactions: 3
  • Comments: 19

Most upvoted comments

It looks likes its an issue with the binary sensors that I changed the key in 12.6.0 of, (smoke and moisture (dry/wet). I’m debugging it

Great, I’ll make a final release asap.

Great. Thanks for reporting back. Closing this issue.

I have released 12.8.2 as final, which is the same as 12.8.2-beta. This should fix the issue for smoke, moisture and gas binary sensors.

@vsimanin @Olegz73 Can you do a check if this version (12.8.2) also fixes the issue for MCCGQ02HL (door/windows sensor)? I haven’t made any changes to the door/window binary sensor, but it could be that the fixes for the other sensors has fixed the door/window sensor as well