NAOqi Core - Overview | API | NotificationInfo
When an application sends a notification:
The notification is removed from the list of pending notifications either when:
For further details about the objects supporting ALNotificationManager, see: NotificationInfo.
Add a notification
# -*- encoding: UTF-8 -*-
#!/usr/bin/env python
from naoqi import ALProxy
ROBOT_IP = "127.0.0.1"
alnotificationmanager = ALProxy("ALNotificationManager", ROBOT_IP, 9559)
notificationId = alnotificationmanager.add({"message": "Hello World!", "severity": "info", "removeOnRead": True})
print "Notification ID: " + str(notificationId)
Print all NotificationInfos
# -*- encoding: UTF-8 -*-
#!/usr/bin/env python
from naoqi import ALProxy
ROBOT_IP = "127.0.0.1"
alnotificationmanager = ALProxy("ALNotificationManager", ROBOT_IP, 9559)
notifications = alnotificationmanager.notifications()
for notification in notifications:
notifDict = dict(notification)
print "Notification ID: " + str(notifDict["id"])
print "\tMessage: " + notifDict["message"]
print "\tSeverity: " + notifDict["severity"]
print "\tRemove On Read: " + str(notifDict["removeOnRead"])
print "-----------\n"