Skip to content

Commit 6b2c390

Browse files
committed
backends/p4android/client: initialize __callbacks to None
Initialize __callbacks to None in the __init__ method. This avoids an AttributeError when reading the is_connected property before the client connects. Fixes: #1791
1 parent 1e6dd6f commit 6b2c390

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0
1010
`Unreleased`_
1111
=============
1212

13+
Fixed
14+
-----
15+
- Fixed ``AttributeError`` in Python4Android backend when accessing ``is_connected`` before connecting. Fixes #1791.
16+
17+
1318
`1.1.0`_ (2025-08-10)
1419
=====================
1520

bleak/backends/p4android/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def __init__(
6161
self.__gatt = None
6262
self.__mtu = 23
6363

64+
self.__callbacks = None
65+
6466
# Connectivity methods
6567

6668
@override

0 commit comments

Comments
 (0)