Notification

class Notification : PlatformTrait, NotificationTrait.Attributes


API for the Notification trait. This trait allows sending notifications as actions to structure members, and is only for use with the Automation API. Household members must have the Google Home app installed.

Summary

Nested types

Public functions

suspend Unit

Send a notification to structure members.

Public properties

open TraitFactory<Notification>

Inherited functions

From com.google.home.google.PlatformTrait
suspend Unit
sendCommand(commandId: String)
suspend Unit
<REQUEST : Any?> sendCommand(
    commandId: String,
    request: PlatformTraitPayload<REQUEST>
)
suspend RESPONSE
<RESPONSE : Any?> sendCommand(
    commandId: String,
    responseParser: Parser<RESPONSE>
)
suspend RESPONSE
<REQUEST : Any?, RESPONSE : Any?> sendCommand(
    commandId: String,
    request: PlatformTraitPayload<REQUEST>,
    responseParser: Parser<RESPONSE>
)

Public functions

sendNotifications

suspend fun sendNotifications(title: String, optionalArgs: NotificationTrait.SendNotificationsCommand.OptionalArgs.() -> Unit = {}): Unit

Send a notification to structure members.

Parameters
title: String

The title of the Google Home App notification.

optionalArgs: NotificationTrait.SendNotificationsCommand.OptionalArgs.() -> Unit = {}

Receiver for the optional arguments of this command.

Public properties

factory

open val factoryTraitFactory<Notification>