Skip to content

Commit 41f7a35

Browse files
authored
Merge pull request #95 from madgrizzle/patch-2
Add READ & NOTIFY Permissions to Battery Service
2 parents f4bd530 + d23e7cf commit 41f7a35

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

adafruit_ble/services/standard/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
from .. import Service
3131
from ...uuid import StandardUUID
32+
from ...characteristics import Characteristic
3233
from ...characteristics.string import StringCharacteristic
3334
from ...characteristics import StructCharacteristic
3435
from ...characteristics.int import Uint8Characteristic
@@ -69,7 +70,11 @@ class BatteryService(Service):
6970
"""Provides battery level information"""
7071

7172
uuid = StandardUUID(0x180F)
72-
level = Uint8Characteristic(max_value=100, uuid=StandardUUID(0x2A19))
73+
level = Uint8Characteristic(
74+
max_value=100,
75+
properties=Characteristic.READ | Characteristic.NOTIFY,
76+
uuid=StandardUUID(0x2A19),
77+
)
7378

7479

7580
class CurrentTimeService(Service):

0 commit comments

Comments
 (0)