![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
node-bravia-serial-control
Advanced tools
The node-bravia-serial-control is a Node.js module which is an implementation of the Serial Control for SONY BRAVIA Professional Displays. You can control BRAVIA Professional Displays from your PC via RS-232C easily using this module.
The node-bravia-serial-control is a Node.js module which is an implementation of the Serial Control for SONY BRAVIA Professional Displays. You can control BRAVIA Professional Displays from your PC via RS-232C easily using this module.
$ cd ~
$ npm install serialport
$ npm install node-bravia-serial-control
BraviaSerialControl
object
BRAVIA Professional Display has a serial port. But the connector is not D-sub which is widely used. It is 3.5 mm stereo mini jack. I personally recommend to use a USB-to-pin-jack TTL Serial Adapter Converter Cable (FTDI chip) to connect your PC and BRAVIA.
The BRAVIA Serial Control is disabled by default. Before you use this module, you have to enable the BRAVIA Serial Control. Visit the official page, see the section "Set up BRAVIA Professional Display" for details.
The BRAVIA Serial Control enables you to retrieve some status or setting modes. The sample code below retrieves the power status of the BRAVIA.
// BraviaSerialControl constructor
const BraviaSerialControl = require('node-bravia-serial-control');
// BraviaSerialControl object
const bravia = new BraviaSerialControl({ path: '/dev/ttyUSB0' });
// Open the serial port
bravia.open().then(() => {
console.log('Opened.');
// Retreive the power status
return bravia.getPowerStatus();
}).then((res) => {
// Show the result
console.log(JSON.stringify(res, null, ' '));
// Close the serial port
return bravia.close();
}).then(() => {
console.log('Closed.');
}).catch((error) => {
console.error(error);
});
In the code above, the variable bravia
is a BraviaSerialControl
object. you can retrieve the status calling the getPowerStatus()
method implemented in the BraviaSerialControl
object.
The code above will output the result as follows:
Opened.
{
"status": false
}
Closed.
As you can see the code above, you have to open the serial port using the open()
method before accessing the BRAVIA.
The BRAVIA Serial Control allows you to change various types of status or mode of the BRAVIA. For example, you can change the picture mode using the setPictureMode()
method:
// BraviaSerialControl constructor
const BraviaSerialControl = require('node-bravia-serial-control');
// BraviaSerialControl object
const bravia = new BraviaSerialControl({ path: '/dev/ttyUSB0' });
// Open the serial port
bravia.open().then(() => {
console.log('Opened.');
// Set the picture mode to "cinema"
return bravia.setPictureMode({ mode: 'cinema' });
}).then(() => {
// Show the result
console.log('Done.');
// Close the serial port
return bravia.close();
}).then(() => {
console.log('Closed.');
}).catch((error) => {
console.error(error);
});
The BRAVIA Serial Control supports the SIRCS (Sony IR Control System) emulation. That is, you can emulate IR commands using this module.
// BraviaSerialControl constructor
const BraviaSerialControl = require('node-bravia-serial-control');
// BraviaSerialControl object
const bravia = new BraviaSerialControl({ path: '/dev/ttyUSB0' });
// Open the serial port
bravia.open().then(() => {
console.log('Opened.');
// Emulate the CC (Closed Caption) button on the remote
return bravia.emulateSircs({ code: 'cc' });
}).then(() => {
// Show the result
console.log('Done.');
// Close the serial port
return bravia.close();
}).then(() => {
console.log('Closed.');
}).catch((error) => {
console.error(error);
});
BraviaSerialControl
objectBraviaSerialControl
objectIn order to use this module , you have to get the BraviaSerialControl
constructor loading this module, then create a BraviaSerialControl
object from the constructor as follows:
// BraviaSerialControl constructor
const BraviaSerialControl = require('node-bravia-serial-control');
// BraviaSerialControl object
const bravia = new BraviaSerialControl({ path: '/dev/ttyUSB0' });
In the code snippet above, the variable bravia
is a BraviaSerialControl
object. The BraviaSerialControl
object has a variety of methods for controlling the BRAVIA as described in sections below.
The constructor takes a hash object containing the properties as follows:
Property | Type | Required | Description |
---|---|---|---|
path | String | Required | The identifier of the serial port (e.g., "/dev/ttyUSB0", "COM3") |
interval | Integer | Optional | Command interval (msec). The value must be an integer in the range of 0 to 1000. The default value is 500 (msec). |
The BRAVIA Serial Control spec says that "Set the command interval to at least 500 ms.". This module automatically handles the constraint. Basically, you don't have to care about the constraint. For example, chaining promises below works well:
// Open the serial port
bravia.open().then(() => {
console.log('Opened.');
// Change the external input to "TV"
return bravia.setInput({ type: 'tv', port: 1 });
}).then(() => {
// Set the brightness to 50
return bravia.setBrightness({ value: 50 });
}).then(() => {
// Change the picture mode to "cinema"
return bravia.setPictureMode({ mode: 'cinema' });
}).then(() => {
// Emulate the CC (Closed Caption) button on the remote
return bravia.emulateSircs({ code: 'cc' });
}).then(() => {
// Power off
return bravia.powerOff();
}).then(() => {
// Show the result
console.log('Done.');
// Close the serial port
return bravia.close();
}).then(() => {
console.log('Closed.');
}).catch((error) => {
console.error(error);
});
Actually, BRAVIAs of recent years might work well even if the interval is shorter than 500 msec. At least, my own BRAVIA worked well even if the interval
was set to 0. (The model of my own BRAVIA is KJ-43X8300D which started to be sold from 2016 in Japan.)
const bravia = new BraviaSerialControl({ path: '/dev/ttyUSB0', interval: 0 });
open()
methodThe open
method opens the serial port and establishes a connection with the BRAVIA. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.open().then(() => {
console.log('Opened.');
});
Note that you have to open the serial port using this method before calling the methods described in the sections below. This module does not automatically open the port.
close()
methodThe close
method closes the serial port. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.close().then(() => {
console.log('Closed.');
});
isOpen()
methodThe isOpen()
method returns the connection status. If the serial port is open, this method returns true
. Otherwise, this method returns false
.
onclose
event handlerThe onclose
event handler will be called when the connection was closed.
bravia.onclose = (event) => {
console.log(JSON.stringify(event, null, ' '));
}
An object containing the information of the event will be passed to the callback function as follows:
close()
method:{
"intentional": true
}
{
"intentional": false
}
getPowerStatus()
methodThe getPowerStatus()
method retrieves the power status of the BRAVIA. This method returns a Promise object.
If the information is fetched successfully, a hash object containing the information will be passed to the resolve()
function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
status | Boolean | true : Active (On), false : Standby (Off) |
bravia.getPowerStatus()..then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
The code above will output the result as follows:
{
"status": true
}
setPowerStatus()
methodThe setPowerStatus()
method changes the power status of the BRAVIA. This method returns a Promise object.
Note that you have to enable the StandBy mode of the BRAVIA using the enableStandby()
method in advance.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
status | Boolean | Optional | true : Active (On), false : Standby (Off) |
If the status
is not specified, this method toggles the power status. That is, if the BRAVIA is turned on, this method turns it off, and vice versa.
bravia.setPowerStatus({ status: false }).then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
If this method was executed successfully, a hash object will be passed to the resolve()
function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
status | Boolean | true : Active (On), false : Standby (Off) |
The code above will output the result as follows:
{
"status": false
}
powerOn()
methodThe powerOn()
method turns on the BRAVIA. This method returns a Promise object.
Note that you have to enable the StandBy mode of the BRAVIA using the enableStandby()
method in advance.
bravia.powerOn()..then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
If this method was executed successfully, a hash object will be passed to the resolve()
function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
status | Boolean | This property always returns true which means Active (On). |
The code above will output the result as follows:
{
"status": true
}
This method is equivalent to the code below:
bravia.setPowerStatus({ status: true })
powerOff()
methodThe powerOff()
method turns off the BRAVIA. This method returns a Promise object.
bravia.powerOff().then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
If this method was executed successfully, a hash object will be passed to the resolve() function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
status | Boolean | This property always returns false which means Standby (Off). |
The code above will output the result as follows:
{
"status": false
}
This method is equivalent to the code below:
bravia.setPowerStatus({ status: false })
togglePowerStatus()
methodThe togglePowerStatus()
method toggles the power status of the BRAVIA like the power button on the remote. That is, if the BRAVIA is turned on, this method turns it off, and vice versa. This method returns a Promise object.
Note that you have to enable the StandBy mode of the BRAVIA using the enableStandby()
method in advance.
bravia.togglePowerStatus().then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
If this method was executed successfully, a hash object will be passed to the resolve()
function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
status | Boolean | true : Active (On), false : Standby (Off) |
The code above will output the result as follows:
{
"status": true
}
This method is equivalent to the code below:
bravia.setPowerStatus()
enableStandby()
methodThe enableStandby()
method enables the StandBy mode of the BRAVIA. This method returns a Promise object.
The StandBy mode is disabled by default. If you want to turn on the BRAVIA using the setPowerStatus()
, powerOn()
, and the togglePowerStatus()
methods, you have to enable the StandBy mode in advance.
bravia.enableStandby().then((res) => {
console.log('Done.');
});
disableStandby()
methodThe disableStandby()
method disables the StandBy mode of the BRAVIA. This method returns a Promise object.
bravia.disableStandby().then((res) => {
console.log('Done.');
});
getInput()
methodThe getInput()
method retrieves the current selected external input. This method returns a Promise object.
If the information is fetched successfully, a hash object containing the information will be passed to the resolve() function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
type | String | "tv" , "video" , "component" , "hdmi" , "pc" , or "shared" |
port | Integer | Port number |
bravia.getInput().then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
The code above will output the result as follows:
{
"type": "hdmi",
"port": 2
}
When the type
is "tv"
, the value of the "port"
does not seem to be a channel number. The BRAVIA Serial Control specification does not provide any information about that.
setInput()
methodThe setInput()
method changes the current selected external input. This method returns a Promise
object. Nothing will be passed to the resolve().
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
type | String | Required | "tv" , "video" , "component" , "hdmi" , "pc" , or "shared" |
port | Integer | Required | 1 - 5 (The maximum number depends on the type ) |
If the type
is set to "tv"
, the value of port
must be 1.
Note that the BRAVIA does not return any error even if a type that the BRAVIA does not support is specified.
bravia.setInput({ type: 'hdmi', port: 1 }).then((res) => {
console.log('Done.');
});
getAudioVolume()
methodThe getAudioVolume()
method retrieves the level of the audio volume. This method returns a Promise
object.
If the information is fetched successfully, a hash object containing the information will be passed to the resolve()
function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
volume | Integer | Current audio volume level. The value may be in the range of 0 to 100. The max value depends on your BRAVIA. |
bravia.getAudioVolume().then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
The code above will output the result as follows:
{
"volume": 20
}
setAudioVolume()
methodThe setAudioVolume()
method changes the level of the audio volume. This method returns a Promise
object.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
volume | Integer | Required | Audio volume level (0 - 100). The max value depends on your BRAVIA. |
bravia.setAudioVolume({ volume: 5 }).then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
If this method was executed successfully, a hash object will be passed to the resolve()
function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
volume | Integer | Audio volume level (0 - 100). The max value depends on your BRAVIA. |
The code above will output the result as follows:
{
"volume": 5
}
volumeUp()
methodThe volumeUp()
method turns up the audio volume the specified steps. This method returns a Promise
object.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
step | Integer | Optional | 1 - 100 (Default: 1) |
bravia.volumeUp({ step: 5 }).then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
If this method was executed successfully, a hash object will be passed to the resolve() function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
volume | Integer | Audio volume level (0 - 100). The max value depends on your BRAVIA. |
The code above will output the result as follows:
{
"volume": 25
}
If the sum of the current level and the specified step is grater than the maximum level, The BRAVIA seems to set the volume level to the maximum level. (At least, my own BRAVIA does so.)
volumeDown()
methodThe volumeDown()
method turns down the audio volume the specified steps. This method returns a Promise
object.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
step | Integer | Optional | 1 - 100 (Default: 1) |
bravia.volumeDown({ step: 5 }).then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
If this method was executed successfully, a hash object will be passed to the resolve() function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
volume | Integer | Audio volume level (0 - 100). The max value depends on your BRAVIA. |
The code above will output the result as follows:
{
"volume": 20
}
If the current level minus the specified step is less than 0, the BRAVIA seems to set the volume level to 0. (At least, my own BRAVIA does so.)
getAudioMute()
methodThe getAudioMute()
method retrieves the audio mute status. This method returns a Promise
object.
If the information is fetched successfully, a hash object containing the information will be passed to the resolve()
function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
status | Boolean | true : Muted, false : Unmuted |
bravia.getAudioMute().then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
The code above will output the result as follows:
{
"status": false
}
setAudioMute()
methodThe setAudioMute()
method changes the audio mute status of the BRAVIA. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
status | Boolean | Optional | true : Mute, false : Unmute |
If the status
is not specified, this method toggles the status.
bravia.setAudioMute({ status: true }).then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
muteAudio()
methodThe muteAudio()
method mutes audio. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.muteAudio().then(() => {
console.log('Done.');
});
This method is equivalent to the code below:
this.setAudioMute({ status: true });
unmuteAudio()
methodThe unmuteAudio()
method unmutes audio. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.unmuteAudio().then(() => {
console.log('Done.');
});
This method is equivalent to the code below:
this.setAudioMute({ status: false });
setOffTimer()
methodThe setOffTimer()
method sets the off (sleep) timer. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
offset | Integer | Required | 0 - 255 (minites) |
The maximum value of the offset
depends on your BRAVIA.
bravia.setOffTimer({ offset: 30 }).then(() => {
console.log('Done.');
});
If you want to cancel the off timer, set the offset
to 0
.
bravia.setOffTimer({ offset: 0 }).then(() => {
console.log('Done.');
});
setPictureMute()
methodThe setPictureMute()
method changes the status of the picture mute. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
status | Boolean | Optional | true : Mute, false : Unmute |
If the status
is not specified, this method toggles the status.
bravia.setPictureMute({ status: true }).then(() => {
console.log('Done.');
});
mutePicture()
methodThe mutePicture()
method mutes picture. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.mutePicture().then(() => {
console.log('Done.');
});
This method is equivalent to the code below:
this.setPictureMute({ status: true });
unmutePicture()
methodThe unmutePicture()
method unmutes picture. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.unmutePicture().then(() => {
console.log('Done.');
});
This method is equivalent to the code below:
this.setPictureMute({ status: false });
getTeletext()
methodThis method possibly does not work well on your BRAVIA. At least, my own BRAVIA returns an error.
The getTeletext()
method retrieves the current teletext mode. This method returns a Promise
object.
If the information is fetched successfully, a hash object containing the information will be passed to the resolve()
. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
mode | String | "off" , "text" , "mix" (MIX-Text ) |
bravia.getTeletext().then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
The code above will output the result as follows:
{
"mode": "text"
}
toggleTeletext()
methodThis method possibly does not work well on your BRAVIA. At least, my own BRAVIA returns an error.
The toggleTeletext()
method toggles the teletext mode. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.toggleTeletext().then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
toggleDisplay()
methodThe toggleDisplay()
method toggles the status whether the current TV channel information is shown or hidden on the screen. This method acts like you press the display (info) key on the remote. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.toggleDisplay().then(() => {
console.log('Done.');
});
setClosedCaptionStatus()
methodThe setClosedCaptionStatus()
method changes the closed caption status. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
status | Boolean | Optional | true : ON, false : OFF |
If the status
is not specified, this method toggles the status.
bravia.setClosedCaptionStatus({ status: true }).then(() => {
console.log('Done.');
});
This method possibly does not work well on your BRAVIA. At least, my own BRAVIA accepts the toggle command, but does not accept the ON/OFF command.
setClosedCaptionMode()
methodThe setClosedCaptionMode()
method changes the closed caption mode. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
type | String | Required | "analog" or "digital" |
mode | String | Required | See the description blow. |
If the type
is "analog"
, the possible values of the mode
are:
cc1
cc2
cc3
cc4
text1
text2
text3
text4
If the type
is "digital"
, the possible values of the mode
are:
service1
service2
service3
service4
service5
service6
cc1
cc2
cc3
cc4
The actual acceptable value of the mode
depends on your BRAVIA.
bravia.setClosedCaptionMode({ type: 'digital', mode: 'cc1' }).then(() => {
console.log('Done.');
});
This method possibly does not work well on your BRAVIA. At least, my own BRAVIA acts as if the command is accepted, but nothing is changed.
setPictureMode()
methodThe setPictureMode()
method changes the picture mode. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
mode | String | Required | See the description blow. |
The possible values of the mode
are:
vivid
standard
cinema
custom
cine2
sports
game
graphic
bravia.setPictureMode({ mode: 'cinema' }).then(() => {
console.log('Done.');
});
setContrast()
methodThe setContrast()
method changes the contrast. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
value | Integer | Required | 0 - 100 |
The actual maximum value of the value
depends on your BRAVIA.
bravia.setContrast({ value: 50 }).then(() => {
console.log('Done.');
});
contrastUp()
methodThe contrastUp()
method increases the contrast one step. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.contrastUp().then((res) => {
console.log('Done.');
});
contrastDown()
methodThe contrastDown()
method decrease the contrast one step. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.contrastDown().then((res) => {
console.log('Done.');
});
setBrightness()
methodThe setBrightness()
method changes the brightness. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
value | Integer | Required | 0 - 100 |
The actual maximum value of the value
depends on your BRAVIA. My own BRAVIA accepts up to 50.
bravia.setBrightness({ value: 50 }).then(() => {
console.log('Done.');
});
brightnessUp()
methodThe brightnessUp()
method increases the brightness one step. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.brightnessUp().then((res) => {
console.log('Done.');
});
brightnessDown()
methodThe brightnessDown()
method decrease the brightness one step. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.brightnessDown().then((res) => {
console.log('Done.');
});
setSaturation()
methodThe setSaturation()
method changes the saturation. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
value | Integer | Required | 0 - 100 |
The actual maximum value of the value
depends on your BRAVIA.
bravia.setSaturation({ value: 60 }).then(() => {
console.log('Done.');
});
saturationUp()
methodThe saturationUp()
method increases the saturation one step. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.saturationUp().then((res) => {
console.log('Done.');
});
saturationDown()
methodThe saturationDown()
method decrease the saturation one step. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.saturationDown().then((res) => {
console.log('Done.');
});
hueUp()
methodThe hueUp()
method strengthens the green tone of the hue the specified steps. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
step | Integer | Optional | 1 - 100 (Default: 1) |
bravia.hueUp({ step: 5 }).then((res) => {
console.log('Done.');
});
hueDown()
methodThe hueDown()
method strengthen the red tone of the hue the specified steps. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
step | Integer | Optional | 1 - 100 (Default: 1) |
bravia.hueDown({ step: 5 }).then((res) => {
console.log('Done.');
});
setSharpness()
methodThe setSharpness()
method changes the sharpness. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
value | Integer | Required | 0 - 100 |
The actual maximum value of the value
depends on your BRAVIA.
bravia.setSharpness({ value: 100 }).then(() => {
console.log('Done.');
});
sharpnessUp()
methodThe sharpnessUp()
method increases the sharpness one step. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.sharpnessUp().then((res) => {
console.log('Done.');
});
sharpnessDown()
methodThe sharpnessDown()
method decrease the sharpness one step. This method returns a Promise
object. Nothing will be passed to the resolve()
.
bravia.sharpnessDown().then((res) => {
console.log('Done.');
});
setCineMotionStatus()
methodThe setCineMotionStatus()
method changes the Cine Motion (Cinema Drive) status. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
status | Boolean | Optional | true : enable, false : disable |
If the status
is not specified, this method toggles the status.
bravia.setClosedCaptionStatus({ status: true }).then(() => {
console.log('Done.');
});
setSoundMode()
methodThe setSoundMode()
method changes the sound mode. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
mode | String | Required | See the description blow. |
The possible values of the mode
are:
standard
cinema
sports
music
game
bravia.setSoundMode({ mode: 'music' }).then(() => {
console.log('Done.');
});
setSpeakerStatus()
methodThe setSpeakerStatus()
method changes the speaker status. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
status | Boolean | Optional | true : ON, false : OFF |
If the status
is set to true
, the built-in speaker will be enabled. If the status
is set to false
, the built-in speaker will be disabled and the external audio system will be selected. If any external audio system is not registered by the BRAVIA, no sound will come out of the BRAVIA.
If the status
is not specified, this method toggles the status.
bravia.setSpeakerStatus({ status: false }).then(() => {
console.log('Done.');
});
shiftScreenPosition()
methodThe shiftScreenPosition()
method shifts the screen position the specified direction and steps. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
h | Integer | Required | Steps of horizontal shift (in the range of -10 to +10 (Default: 0)) |
v | Integer | Required | Steps of Vertical shift (in the range of -10 to +10 (Default: 0)) |
If the value of the h
is grater than 0, the screen will shift to the right. If the value of the h
is less than 0, the screen will shift to the left.
If the value of the v
is grater than 0, the screen will shift to the top. If the value of the v
is less than 0, the screen will shift to the bottom.
The actual maximum value of the value
depends on your BRAVIA. Some model might not support the vertical shift.
bravia.shiftScreenPosition({ h: -3, v: 0 }).then(() => {
console.log('Done.');
});
setScreenWideMode()
methodThe setScreenWideMode()
method changes the screen wide mode. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
mode | String | Optional | See the description blow. |
The possible values of the mode
are:
wide_zoom
full
zoom
normal
pc_normal
pc_full1
pc_full2
The actual acceptable value of the mode
depends on your BRAVIA. If the mode
is not specified, this method toggles the mode.
bravia.setScreenWideMode({ mode: 'full' }).then(() => {
console.log('Done.');
});
setScreenAutoWideStatus()
methodThe setScreenAutoWideStatus()
method changes the screen auto wide status. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
status | Boolean | Optional | true : ON, false : OFF |
If the status
is not specified, this method toggles the status.
return bravia.setScreenAutoWideStatus({ status: true }).then(() => {
console.log('Done.');
});
setScreen4To3Mode()
methodThe setScreen4To3Mode()
method changes the screen 4:3 mode. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
mode | String | Optional | See the description blow. |
The possible values of the mode
are:
normal
wide_zoom
off
The actual acceptable value of the mode
depends on your BRAVIA. If the mode
is not specified, this method toggles the mode.
bravia.setScreen4To3Mode({ mode: 'normal' }).then(() => {
console.log('Done.');
});
emulateSircs()
methodThe emulateSircs()
method send a SIRCS (Sony IR Control System) code. This method returns a Promise
object. Nothing will be passed to the resolve()
.
This method takes a hash object as an argument containing properties as follows:
Property | Type | Required | Description |
---|---|---|---|
code | String | Required | See the description blow. |
The possible values of the code
are:
input
tvPower
wide
dot
display
return
options
home
up
down
left
right
select
num1
num2
num3
num4
num5
num6
num7
num8
num9
num0
cc
volumeUp
volumeDown
mute
channelUp
channelDown
jump
bravia.emulateSircs({ code: 'tvPower' }).then(() => {
console.log('Done.');
});
Note that the BRAVIA might not be able to turned on using the tvPower
code even if the StandBy mode is enabled.
getSignageInfo()
methodThe getSignageInfo()
method retrieves the signage settings. This method returns a Promise object.
If the information is fetched successfully, a hash object containing the information will be passed to the resolve() function. The hash object has the properties as follows:
Property | Type | Description |
---|---|---|
command | String | ID Command (HEX) |
info1 | String | Product info 1 |
info2 | String | Product info 2 |
info3 | String | Product info 3 |
bravia.getSignageInfo().then((res) => {
console.log(JSON.stringify(res, null, ' '));
});
The code above will output the result as follows:
{
"command": "ba",
"info1": "KJ-43X",
"info2": "8300D",
"info3": ""
}
The MIT License (MIT)
Copyright (c) 2019 Futomi Hatano
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
The node-bravia-serial-control is a Node.js module which is an implementation of the Serial Control for SONY BRAVIA Professional Displays. You can control BRAVIA Professional Displays from your PC via RS-232C easily using this module.
The npm package node-bravia-serial-control receives a total of 0 weekly downloads. As such, node-bravia-serial-control popularity was classified as not popular.
We found that node-bravia-serial-control demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.