Skip to content

Commit

Permalink
feat: Allow update bleak device
Browse files Browse the repository at this point in the history
  • Loading branch information
IATkachenko committed Aug 19, 2022
1 parent b228fb8 commit a811e1d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tion_btle/tion.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,3 +564,10 @@ async def _get_data_from_breezer(self) -> bytearray:
raise TionException("_get_data_from_breezer", "Could not get breezer state")

return result

@final
def update_btle_device(self, new_device: str | BLEDevice):
if new_device is None:
_LOGGER.info(f"Skipping update due to {new_device= }!")
return
self._btle = BleakClient(new_device)

0 comments on commit a811e1d

Please sign in to comment.