Skip to content

Sort object_ids when packing to avoid problems #9

@DavesCodeMusings

Description

@DavesCodeMusings

According to https://bthome.io/format/

Object ids have to be applied in numerical order (from low to high) in your advertisement. This will make sure that if you have a device (sensor) that is broadcasting a new measurement type that is added in a new (minor) BTHome update, while your BTHome receiver isn't updated yet to the same version, it will still be able to receive the older supported measurement types. A BTHome receiver will stop parsing object ids as soon as it finds an object id that isn't supported.

So in _pack_service_data(self, *args), the line for object_id in args: should be for object_id in sorted(args): to put them in order by object_id rather than relying on the user to enter them in proper order.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions