Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk): add support for notification channel in NotifierOptions #1625

Merged
merged 3 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions plugins/diagnostics/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class DiagnosticsPlugin extends ScryptedDeviceBase implements Settings {
await device.sendNotification('Scrypted Diagnostics', {
body: 'Body',
subtitle: 'Subtitle',
android: {
channel: 'diagnostics',
}
}, mo);

this.warnStep(console, 'Check the device for the notification.');
Expand Down
4 changes: 4 additions & 0 deletions sdk/types/scrypted_python/scrypted_sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,13 @@ class MediaStreamOptions(TypedDict):
tool: MediaStreamTool # The tool was used to write the container or will be used to read teh container. Ie, scrypted, the ffmpeg tools, gstreamer.
video: VideoStreamOptions

class AndroidNotificationOptions(TypedDict):
channel: str

class NotifierOptions(TypedDict):

actions: list[NotificationAction]
android: AndroidNotificationOptions
badge: str
body: str
bodyWithSubtitle: str
Expand Down
3 changes: 3 additions & 0 deletions sdk/types/src/types.input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ export interface NotifierOptions {
badge?: string;
bodyWithSubtitle?: string;
body?: string;
android?: {
channel?: string;
}
data?: any;
dir?: NotificationDirection;
lang?: string;
Expand Down