platypush/platypush/backend/http/static/js/assistant.google.js
Fabio Manganiello d83c2c903f - Added support for /dashboard page with customizable widgets under the web server
- Introduced Redis to pass messages between the Flask process and the
main application. It now syncs messages with the bus and connected websockets
- Added support to programmatically modify dashboard widgets through POST request like Dashing
- Added weather forecast plugin
2018-05-04 03:24:35 +02:00

38 lines
960 B
JavaScript

$(document).ready(function() {
var onEvent = function(event) {
console.log(event);
switch (event.args.type) {
case 'platypush.message.event.assistant.ConversationStartEvent':
createNotification({
'text': 'Assistant listening',
'icon': 'microphone',
});
break;
case 'platypush.message.event.assistant.SpeechRecognizedEvent':
createNotification({
'title': 'Speech recognized',
'text': event.args.phrase,
'icon': 'microphone',
});
break;
case 'platypush.message.event.assistant.ConversationEndEvent':
break;
}
};
var initEvents = function() {
window.registerEventListener(onEvent);
};
var init = function() {
initEvents();
};
init();
});