Skip to content

Commit

Permalink
Minor readme and examples cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafostar committed Sep 13, 2019
1 parent 479ac17 commit f7cecf7
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ cecCtl.on('error', console.error);
language: 'eng',
turnOn: [Function: bound changePower], // Turn on dev0 (TV)
turnOff: [Function: bound changePower], // Turn off dev0 (TV)
changeSource: [Function] }, // Switch HDMI input (optional arg is port number)
changeSource: [Function], // Switch HDMI input (optional arg is port number)
sendKey: [Function] // Send key press to this device
},
dev4: {
name: 'Playback 1',
logicalAddress: '4',
Expand All @@ -51,7 +53,7 @@ cecCtl.on('error', console.error);
volumeUp: [Function: bound command], // Increase amplifier volume
volumeDown: [Function: bound command], // Decrease amplifier volume
mute: [Function: bound command], // Mute amplifier
getKeyNames: [Function: bound getNamesArray] // Returns array of supported keys (for use with sendKey())
getKeyNames: [Function: bound getNamesArray], // Returns array of supported keys (for use with sendKey())
command: [Function: command] // Send custom signal (arg is send as input to cec-client)
}
*/
Expand Down Expand Up @@ -135,7 +137,7 @@ controlTv();
increaseVolume(3); // Increase volume 3 times
```

Additional pre-made scripts can be found inside "test" folder.
Additional pre-made runnable scripts can be found inside "test" folder.

## Donation
If you like my work please support it by buying me a cup of coffee :-)
Expand Down
2 changes: 0 additions & 2 deletions test/activate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
*/

const cecInit = require('./shared/init');
const writeLine = require('./shared/writeLine');
cecInit().then(test);

function test(obj)
{
writeLine('');
console.log('--- TV Active Source Changed ---\n');
console.log('CURRENT STATUS');
console.log(obj.controller);
Expand Down
5 changes: 3 additions & 2 deletions test/control-decoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Use arrow keys from your PC as arrows buttons to control TV.
Use arrow keys from your PC as arrows buttons to control decoder.
Select with "Spacebar". Close app with Ctrl+c.
*/

const cecInit = require('./shared/init');
Expand All @@ -12,7 +13,7 @@ var enabled = true;

function test(obj)
{
console.log('--- Control dev1 with keyboard arrow keys, select with "Spacebar" ---\n');
console.log('--- Control dev1 with keyboard arrow keys, select with "Spacebar" ---');

process.stdin.on('data', async(key) =>
{
Expand Down
3 changes: 1 addition & 2 deletions test/hdmi-switch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Toggles between 3 available HDMI ports.
Port number can be set with 'hdmiPorts' option when creating new cec-controller object.
Number of HDMI ports can be set with 'hdmiPorts' option when creating new cec-controller object.
Desired port number can also be passed to 'changeSource()' function
(e.g. ctl.dev0.changeSource(2) should switch to input 2).
*/
Expand All @@ -13,7 +13,6 @@ function test(obj)
{
var ctl = obj.controller;

writeLine('');
console.log('--- TV HDMI Switch Test ---');

writeLine(`Switching port every 5 sec...`);
Expand Down
1 change: 0 additions & 1 deletion test/power.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ function test(obj)
{
var ctl = obj.controller;

writeLine('');
console.log('--- TV Power Test ---');
writeLine('Turning OFF in 30 sec...');
setTimeout(() => powerOff(ctl), 30000);
Expand Down
1 change: 0 additions & 1 deletion test/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function test(obj)
{
var cec = obj.cec;

writeLine('');
console.log('--- TV Remote Test ---');
writeLine('Press any button on TV remote');

Expand Down
1 change: 1 addition & 0 deletions test/shared/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = () =>
writeLine('Setting this device as active source...');
await controller.setActive();

writeLine('');
resolve({ controller, cec });
});

Expand Down

0 comments on commit f7cecf7

Please sign in to comment.