Skip to content

Commit a4bd08b

Browse files
committed
Documentation update
1 parent 03d029f commit a4bd08b

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

services/device_service.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@
77

88

99
class DeviceService:
10-
"""A service for registering and managing devices."""
10+
"""
11+
A service for registering and managing devices.
12+
13+
Attributes:
14+
session (Session): The database session to use. Injected by FastAPI.
15+
16+
Methods:
17+
register_device(device: Device) -> Device: Register a device.
18+
get_registered_devices() -> list[Device]: Get all registered devices.
19+
clear_registered_devices() -> None: Clear all registered devices.
20+
"""
1121

1222
def __init__(self, session: Session = Depends(db_session)):
1323
"""
@@ -44,7 +54,8 @@ def get_registered_devices(self) -> list[Device]:
4454
return [device.to_model() for device in devices]
4555

4656
def clear_registered_devices(self) -> None:
47-
"""Clear all registered devices.
57+
"""
58+
Clear all registered devices.
4859
4960
This method deletes all registered devices from the database.
5061
"""

services/push_service.py

+18-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,30 @@ class PushService:
99
1010
Attributes:
1111
handler (PushHandler): The handler used to send push notifications. Injected by FastAPI.
12+
13+
Methods:
14+
send_push(message: Message) -> None: Sends a push notification.
1215
"""
1316

1417
def __init__(self, handler: PushHandler = Depends()):
15-
"""Initialize the Service."""
18+
"""
19+
Initialize the PushService.
20+
21+
Args:
22+
handler (PushHandler): The push notification handler to use. Injected by FastAPI.
23+
"""
1624
self.handler = handler
1725

1826
def send_push(self, message: Message) -> None:
19-
"""Send a push notification."""
27+
"""
28+
Send a push notification.
29+
30+
Args:
31+
message (Message): The message to send.
32+
33+
Returns:
34+
None
35+
"""
2036
self.handler.send_multiple_push(
2137
to_device_tokens=message.recipients, body=message.body
2238
)

0 commit comments

Comments
 (0)