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

Add notifications and sounds to schema #1064

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Add notifications and sounds to schema #1064

merged 2 commits into from
Apr 30, 2024

Conversation

rohansingh
Copy link
Member

@rohansingh rohansingh commented Apr 30, 2024

Add the ability to specific app notifications and sounds in the schema.

Here is an example:

def get_schema():
    return schema.Schema(
        version = "1",
        notifications = [
            schema.Notification(
                id = "notificationid",
                name = "Notification",
                desc = "A Notification",
                icon = "notification",
                sounds = [
                    schema.Sound(
                        title = "Ding!",
                        file = ding_mp3,
                    ),
                ],
            ),
        ],
    )

This change makes the Schema and SchemaJSON fields of Applet public, so that embedders can inspect the schema and access the sound files that are referenced by schema.Sound.

Also, the File type is moved to runtime/modules to avoid a circular dependency between runtime and schema.

Add the ability to specific app notifications and sounds in the schema.
Here is an example:

```starlark
def get_schema():
    return schema.Schema(
        version = "1",
        notifications = [
            schema.Notification(
                id = "notificationid",
                name = "Notification",
                desc = "A Notification",
                icon = "notification",
                sounds = [
                    schema.Sound(
                        title = "Ding!",
                        file = ding_mp3,
                    ),
                ],
            ),
        ],
    )
```

This change makes the `Schema` and `SchemaJSON` fields of `Applet`
public, so that embedders can inspect the schema and access the sound
files that are referenced by `schema.Sound`.
Bazel files are generated as part of Tidbyt's internal development
process but are not used for the open source build.
@rohansingh rohansingh requested a review from matslina April 30, 2024 17:31
@rohansingh rohansingh merged commit e09293d into main Apr 30, 2024
7 checks passed
@rohansingh rohansingh deleted the rohan/sound branch April 30, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant