2.0.1 • Published 2 years ago

google-home-player v2.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
2 years ago

google-home-player

Play a sound or say a text on Google Home. This is an alternative implementation of google-home-notifier by using Promise.

Usage

var GoogleHomePlayer = require('google-home-player');

var ip = 'x.x.x.x'; // your Google Home's ip address

var googleHome = new GoogleHomePlayer(ip, 'en');
googleHome
  .say('first text')
  .then(function() {
    return googleHome.say('second text', 'ja', true);
  })
  .then(function() {
    return googleHome.say('final text');
  })
  .then(function() {
    console.log('done');
  })
  .catch(function(err) {
    console.error(err);
  });

Usage with async/await

const example = async () => {
  await googleHome.say('first text');
  await googleHome.say('second text', 'ja', true);
  await googleHome.say('final text');
  console.log('done');
};

example().catch(err => {
  console.error(err);
});
2.0.1

2 years ago

2.0.0

2 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago