I see that you added some code to process the advertisement data. It would be nice if it also decoded the manufacturer-specific data present in ad_data.manufacturer_data[1794]. It is structured as follows:
┌ A┐B┐ C┐D───┐E┐ F┐
│ 210a 0400 000c 0f
└ │ │ │ │ │ │
21│──│─│────│──│─── device state
└ 0010 0001
││││ │ │└ device is disconnected
││││ │ └ unknown
││││ └ calibration state:
││││ 00: not active
││││ 01: "end request"
││││ 10: in progress
││││ 11: error
│││└ DFU mode active
││└ "Smart Home Integration" (i.e. 0x0038 handle) is enabled
│└ unknown
└ unknown
0a─│─│────│──│─── patch version number
04│────│──│─── minor version number
0000│──│─── major version number (uLE16)
0c─│─── hardware revision
0f── unknown
If DFU mode is not active, the version numbers correspond to the firmware version. If DFU mode is active, the version numbers correspond to the bootloader version.
I see that you added some code to process the advertisement data. It would be nice if it also decoded the manufacturer-specific data present in
ad_data.manufacturer_data[1794]
. It is structured as follows:If DFU mode is not active, the version numbers correspond to the firmware version. If DFU mode is active, the version numbers correspond to the bootloader version.
As an aside, the Bleak documentation notes that
register_detection_callback
is deprecated. As such, this code should be updated: https://github.com/Anrijs/Aranet4-Python/blob/613bc120add2bc1179d57567b93cfcb9cfd8205e/aranet4/client.py#L496-L497 To something like this:As a fun side bonus, you could use the
service_uuids
parameter to let Bleak do the device filtering for you: