Bluetooth-Devices / govee-ble

Manage Govee BLE devices
Apache License 2.0
19 stars 10 forks source link

H5178 index out of range #48

Closed PierreAronnax closed 1 year ago

PierreAronnax commented 1 year ago

Describe the bug I see you have merged https://github.com/Bluetooth-Devices/govee-ble/pull/47 without the suggested change in my review. For H5178 it must be temp, humi = decode_temp_humid(data[3:6]) just like the old line was packet_5178 = data[3:6].hex()

Additional context

2022-12-15 10:11:17.492 ERROR (MainThread) [homeassistant.components.govee_ble] Unexpected error updating B51782BC8 data: index out of range
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_processor.py", line 124, in _async_handle_bluetooth_event
    update = self._update_method(service_info)
  File "/usr/local/lib/python3.10/site-packages/bluetooth_sensor_state_data/__init__.py", line 66, in update
    self._start_update(data)
  File "/usr/local/lib/python3.10/site-packages/govee_ble/parser.py", line 78, in _start_update
    self._process_mfr_data(address, local_name, mfr_id, mfr_data, service_uuids)
  File "/usr/local/lib/python3.10/site-packages/govee_ble/parser.py", line 172, in _process_mfr_data
    temp, humi = decode_temp_humid(data[3:5])
  File "/usr/local/lib/python3.10/site-packages/govee_ble/parser.py", line 37, in decode_temp_humid
    (temp_humid_bytes[0] << 16) + (temp_humid_bytes[1] << 8) + temp_humid_bytes[2]
IndexError: index out of range
bdraco commented 1 year ago

I don't see your suggested change in the review

bdraco commented 1 year ago

I reverted #47

PierreAronnax commented 1 year ago

No? afbeelding

bdraco commented 1 year ago

Your comment is still pending

PierreAronnax commented 1 year ago

My bad, first time using that feature... (not really intuitive)

bdraco commented 1 year ago

thanks fixed in #50