issue #10 #11 #12 Apply system reboot feature on instant_power mode set as 2. Change language popup titile and usage displaying method.
This commit is contained in:
@@ -46,6 +46,11 @@ HotelTV.hal = (function() {
|
||||
'end_of_item'
|
||||
];
|
||||
|
||||
let hcap_property_installer_menuItem_key = [
|
||||
hcap.property.InstallerMenuItem.POWER_MANAGE,
|
||||
hcap.property.InstallerMenuItem.MAX_VOLUME
|
||||
];
|
||||
|
||||
|
||||
|
||||
const g_media = {
|
||||
@@ -113,7 +118,7 @@ HotelTV.hal = (function() {
|
||||
};
|
||||
|
||||
/**
|
||||
* HCAP Wrapper Function::> Get Device Properties(Realted HCAP API:hcap.property.setProperty)
|
||||
* HCAP Wrapper Function::> Set Device Properties(Realted HCAP API:hcap.property.setProperty)
|
||||
* @param {string} sz_key property key name.
|
||||
* @param {object} value is object to setting property
|
||||
*/
|
||||
@@ -129,6 +134,39 @@ HotelTV.hal = (function() {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* HCAP Wrapper Function::> Get Installer Menu Item(Realted HCAP API:hcap.property.getInstallerMenuItem)
|
||||
* @param {string} sz_key installer menu item key name.
|
||||
*/
|
||||
function __hcapfxn_get_installer_menuItem(sz_key) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let param = {
|
||||
"key": sz_key,
|
||||
"onSuccess": function(s) { resolve({ "key": sz_key, "value": s.value }) },
|
||||
//"onFailure": function(f) { reject({ "key": sz_key, "value": "unknown" }) }
|
||||
"onFailure": function(f) { resolve({ "key": sz_key, "value": "unknown" }) }
|
||||
};
|
||||
hcap.property.getInstallerMenuItem(param);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* HCAP Wrapper Function::> Set Installer Menu Item(Realted HCAP API:hcap.property.setInstallerMenuItem)
|
||||
* @param {string} sz_key installer menu item key name.
|
||||
* @param {object} value is object to setting installer menu item
|
||||
*/
|
||||
function __hcapfxn_set_installer_menuItem(sz_key, value) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let param = {
|
||||
"key": sz_key,
|
||||
"value": value.toString(),
|
||||
"onSuccess": function(s) { resolve({ "key": sz_key, "value": value }) },
|
||||
"onFailure": function(f) { resolve({ "key": sz_key, "value": "unknown" }) }
|
||||
};
|
||||
hcap.property.setInstallerMenuItem(param);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* IDCAP Wrapper Function::> Get Device Configuration(Properties)(Realted IDCAP API:idcap://configuration/property/get)
|
||||
* @param {string} sz_key property key name.
|
||||
@@ -671,7 +709,7 @@ HotelTV.hal = (function() {
|
||||
return new Promise((resolve, reject) => {
|
||||
hcap.network.getNetworkInformation({
|
||||
"onSuccess" : function(s) {
|
||||
console.log("onSuccess : network_mode = " + s.network_mode +
|
||||
console.log("onSuccess : network_mode = " + s.network_mode +
|
||||
"\n ssid = " + s.ssid +
|
||||
"\n eth_speed = " + s.eth_speed +
|
||||
"\n eth_duplex = " + s.eth_duplex +
|
||||
@@ -691,7 +729,7 @@ HotelTV.hal = (function() {
|
||||
"\n wifi_plugged = " + s.wifi_plugged +
|
||||
"\n dhcp_state = " + s.dhcp_state);
|
||||
resolve({ "error": false, "info": s });
|
||||
},
|
||||
},
|
||||
"onFailure" : function(f) {
|
||||
console.log("onFailure : errorMessage = " + f.errorMessage);
|
||||
resolve({ "error": true, "info": null });
|
||||
@@ -955,10 +993,39 @@ HotelTV.hal = (function() {
|
||||
let _instant_pwr_target_mode = Number(_devconfig.system.misc.instantPower);
|
||||
if (_devinfo["instant_power"] != _instant_pwr_target_mode) {
|
||||
_pmFxnArProperty.push(__hcapfxn_set_property('instant_power', _instant_pwr_target_mode));
|
||||
|
||||
// hcap.property.InstallerMenuItem.POWER_MANAGE 설정
|
||||
if ( _instant_pwr_target_mode==2 ) {
|
||||
//
|
||||
hcap.property.setInstallerMenuItem({
|
||||
"key" : hcap.property.InstallerMenuItem.POWER_MANAGE,
|
||||
"value" : 8,
|
||||
"onSuccess" : function() {
|
||||
console.log("onSuccess");
|
||||
},
|
||||
"onFailure" : function(f) {
|
||||
console.log("onFailure : errorMessage = " + f.errorMessage);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Sets number of hours of no activity before automatic shut off. (0 ~ 7)
|
||||
hcap.property.setInstallerMenuItem({
|
||||
"key" : hcap.property.InstallerMenuItem.POWER_MANAGE,
|
||||
"value" : 0,
|
||||
"onSuccess" : function() {
|
||||
console.log("onSuccess");
|
||||
},
|
||||
"onFailure" : function(f) {
|
||||
console.log("onFailure : errorMessage = " + f.errorMessage);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ( _instant_pwr_target_mode==2 || _instant_pwr_target_mode==1 ){
|
||||
_pmFxnArProperty.push(__hcapfxn_set_powermode('power_mode', hcap.power.PowerMode.WARM));
|
||||
if (_devinfo["power_mode"] != hcap.power.PowerMode.WARM) {
|
||||
_pmFxnArProperty.push(__hcapfxn_set_powermode('power_mode', hcap.power.PowerMode.WARM));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1771,7 +1838,7 @@ HotelTV.hal = (function() {
|
||||
},
|
||||
|
||||
/**
|
||||
* _keyValue는 아래 코드중 하나
|
||||
* _keyValue는 아래 코드중 하나
|
||||
* hcap.key.Code.ENTER
|
||||
* hcap.key.Code.LEFT
|
||||
* hcap.key.Code.RIGHT
|
||||
@@ -1780,12 +1847,12 @@ HotelTV.hal = (function() {
|
||||
* hcap.key.Code.DOWN
|
||||
* hcap.key.Code.CH_UP
|
||||
* hcap.key.Code.CH_DOWN
|
||||
* @param {enum} _keyValue
|
||||
* @param {enum} _keyValue
|
||||
*/
|
||||
SendVirKeyEvent: function(_keyValue) {
|
||||
hcap.key.sendKey({
|
||||
"virtualKeycode" : _keyValue,
|
||||
"onSuccess" : function() { },
|
||||
"onSuccess" : function() { },
|
||||
"onFailure" : function(f) {
|
||||
console.error("onFailure : errorMessage = " + f.errorMessage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user