Skip to content

Commit

Permalink
Merge pull request #193 from benquike/main
Browse files Browse the repository at this point in the history
Update device name in advertising data from load_from_dict
  • Loading branch information
barbibulle committed May 24, 2023
2 parents 5790d3a + 22f7cef commit a74c39d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bumble/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,12 @@ def load_from_dict(self, config: Dict[str, Any]) -> None:
advertising_data = config.get('advertising_data')
if advertising_data:
self.advertising_data = bytes.fromhex(advertising_data)
elif config.get('name') is not None:
self.advertising_data = bytes(
AdvertisingData(
[(AdvertisingData.COMPLETE_LOCAL_NAME, bytes(self.name, 'utf-8'))]
)
)

def load_from_file(self, filename):
with open(filename, 'r', encoding='utf-8') as file:
Expand Down

0 comments on commit a74c39d

Please sign in to comment.