Bluetooth-Devices / bthome-ble

Parser for BTHome BLE devices
https://bthome.io/
MIT License
64 stars 11 forks source link

feat: add device title to log messages #113

Closed thecode closed 4 months ago

thecode commented 4 months ago

I have a Shelly device with a buggy firmware which constantly log this message:

BTHome device is not sending object ids in numerical order (from low to high object id). This can cause issues with your BTHome receiver, payload: 008a016445c40005e02e002101

The message doesn't help identifying the device (although I know it is one of two devices) and in use case of multiple devices it would be hard to identify which device is logging the message and may be confusing when trying to analyze logs.

Added device title where it is possible and added/modified tests to cover the log messages

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.60%. Comparing base (113e49d) to head (6cc0f60). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #113 +/- ## ========================================== + Coverage 81.28% 82.60% +1.32% ========================================== Files 6 6 Lines 529 529 Branches 82 82 ========================================== + Hits 430 437 +7 + Misses 78 73 -5 + Partials 21 19 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Ernst79 commented 4 months ago

I have one minor comment, I think we should have a colon after the name/title of the device. E.g.

ATC 18B2 New packet_id 9 indicates an older packet (previous packet_id 9).

should be

ATC 18B2: New packet_id 9 indicates an older packet (previous packet_id 9).

Sorry for this, but we can better do it correct now.

thecode commented 4 months ago

I have one minor comment, I think we should have a colon after the name/title of the device. E.g. ATC 18B2: New packet_id 9 indicates an older packet (previous packet_id 9).

Good point, fixing