Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite of parser #365

Closed
11 tasks done
Ernst79 opened this issue May 26, 2021 · 5 comments
Closed
11 tasks done

Rewrite of parser #365

Ernst79 opened this issue May 26, 2021 · 5 comments

Comments

@Ernst79
Copy link
Collaborator

Ernst79 commented May 26, 2021

I'm going to rewrite the parser, such that it only parses the service data. This issue will be used to keep track of the process

  • Prepare __init__.py to extract the service data (version 2.4.3)
  • Remove the binary/measuring type out of the parser (version 2.4.3)
  • Fix the whitelist option to not reverse the MAC (version 2.5.0)
  • Fix the key dictionary to not reverse the MAC (version 2.5.0)
  • Xiaomi parser (2.8.1)
  • Kegtron parser (version 2.5.0)
  • Qingping parser (version 2.5.1)
  • MiScale parser (version 2.6.1)
  • ATC parser (2.7.1)
  • Add encrypted ATC format (2.7.1)
  • Rewrite sensor and binary sensor part to new measuring type dict (3.0.0)

Inspired by custom pvvx version of BLE monitor

@airy10
Copy link

airy10 commented Jun 3, 2021

I'm getting this exception with 2.8.0-beta - 2.7.1 is fine
My devices are using pvvc firmware - pvvc ad format, not encrypted

2021-06-03 12:38:19 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/ble_monitor/sensor.py", line 189, in async_run
sensors = await async_add_sensor(mac, sensortype, firmware)
File "/config/custom_components/ble_monitor/sensor.py", line 116, in async_add_sensor
sensors.insert(h_i, HumiditySensor(self.config, mac, sensortype, firmware))
File "/config/custom_components/ble_monitor/sensor.py", line 684, in __init__
if self._device_firmware[0:6] == "Xiaomi":
TypeError: 'NoneType' object is not subscriptable

@Ernst79
Copy link
Collaborator Author

Ernst79 commented Jun 3, 2021

Hmm, strange. Could you check something for me. When you open a sensor, e.g. a temperature measurement, could you check the attribute Firmware. What is it saying? Is one of them saying None?

image

@airy10
Copy link

airy10 commented Jun 3, 2021

Looks like it's because I have some sensors that used to be reachable by my HA PI (using some older version of the BLE integration) but currently aren't anymore (I'm using a esphome bridge for them)
Last states knows for these entities don't have the "firmware" attribute and I guess that it's the problem
All of the reachable devices are "ATC (Custom)"

@Ernst79
Copy link
Collaborator Author

Ernst79 commented Jun 3, 2021

Ok, I will just add a check for "not None" Thanks for reporting.

Fixed in 2.8.1-beta

@airy10
Copy link

airy10 commented Jun 3, 2021

Thanks. My setup is happy again with 2.8.1-beta 👍

@Ernst79 Ernst79 closed this as completed Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants