You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 26, 2023. It is now read-only.
Hey I've an problem with this lines: function startTv(): void { const TvApi = require('node-lgtv-api'); const tvApi = new TvApi('192.168.1.192', '8080', '325887'); tvApi.setDebugMode(true); console.log(tvApi); tvApi.authenticate().then(() => { tvApi.processCommand(tvApi.TV_CMD_NUMBER_4, [], function (err, data) { if (err) { console.error(err); } else { console.log(data); } }); }); }
Error: Unhandled Promise rejection: Invalid character in name ; Zone: <root> ; Task: Promise.then ; Value: Error: Invalid character in name at XMLStringifier../node_modules/xmlbuilder/lib/XMLStringifier.js.module.exports.XMLStringifier.assertLegalName (server/main.js:175469:15) at XMLStringifier.assertLegalName (server/main.js:175260:59) at XMLStringifier../node_modules/xmlbuilder/lib/XMLStringifier.js.module.exports.XMLStringifier.name server/main.js:175285:19) at new XMLElement (server/main.js:173730:34) at XMLElement../node_modules/xmlbuilder/lib/XMLNode.js.module.exports.XMLNode.node (server/main.js:174386:15) at XMLElement../node_modules/xmlbuilder/lib/XMLNode.js.module.exports.XMLNode.element (server/main.js:174318:28) at XMLElement../node_modules/xmlbuilder/lib/XMLNode.js.module.exports.XMLNode.ele (server/main.js:174613:19) at server/main.js:171031:42 at Builder../node_modules/xml2js/lib/builder.js.exports.Builder.Builder.buildObject (server/main.js:171086:14) at server/main.js:134003:39 Error: Invalid character in name at XMLStringifier../node_modules/xmlbuilder/lib/XMLStringifier.js.module.exports.XMLStringifier.assertLegalName (server/main.js:175469:15) at XMLStringifier.assertLegalName (server/main.js:175260:59) at XMLStringifier../node_modules/xmlbuilder/lib/XMLStringifier.js.module.exports.XMLStringifier.name (server/main.js:175285:19) at new XMLElement (server/main.js:173730:34) at XMLElement../node_modules/xmlbuilder/lib/XMLNode.js.module.exports.XMLNode.node (server/main.js:174386:15) at XMLElement../node_modules/xmlbuilder/lib/XMLNode.js.module.exports.XMLNode.element (server/main.js:174318:28) at XMLElement../node_modules/xmlbuilder/lib/XMLNode.js.module.exports.XMLNode.ele (server/main.js:174613:19) at server/main.js:171031:42 at Builder../node_modules/xml2js/lib/builder.js.exports.Builder.Builder.buildObject (server/main.js:171086:14) at server/main.js:134003:39
It seems something wrong at line 67. Try this tvApi.processCommand(tvApi.TV_CMD_MUTE_TOGGLE, []).then(resp => console.log (resp), err=>console.error(err));
Declaration of function https://github.com/timmson/node-lgtv-api/blob/master/app.js#L56 says processCommand have only 2 parameters: commandName, parameters. Unfortunately, i dont have this model of TV anymore and have no chances to check it right now. However, req and resp are right, thats why you can suggest PR, if you would find the root of problem, thx!
Activity
timmson commentedon Sep 13, 2020
Hi, @matjanfedev
Could you post request and response? They should be printed to the console, if setDebug was true.
matjanfedev commentedon Sep 13, 2020
timmson commentedon Sep 13, 2020
It seems something wrong at line 67. Try this
tvApi.processCommand(tvApi.TV_CMD_MUTE_TOGGLE, []).then(resp => console.log (resp), err=>console.error(err));matjanfedev commentedon Sep 13, 2020
it doesnt matter. With then() is the same effect.
The red line under ''function'' is a ts-lint issue (suggest to change into arrow function)
timmson commentedon Sep 14, 2020
Declaration of function https://github.com/timmson/node-lgtv-api/blob/master/app.js#L56 says processCommand have only 2 parameters:
commandName,parameters. Unfortunately, i dont have this model of TV anymore and have no chances to check it right now. However, req and resp are right, thats why you can suggest PR, if you would find the root of problem, thx!mrazon87 commentedon Sep 4, 2021
Hi everyone, did you find the solution for the "Error: Invalid character in name" issue? I have completely the same...
Many thanks!
Error: Invalid character in name #17
Error: Invalid character in name #17
Error: Invalid character in name #17
timmson commentedon Mar 23, 2022
Hi, @abossard, @matjanfedev, @kennyyuen
Could you test this version, plz? - https://www.npmjs.com/package/node-lgtv-api/v/0.9.8
TomHart commentedon Jan 3, 2023
I'm having this issue with version 0.9.8 still
timmson commentedon Jan 9, 2023
Hi! Could you debug and fix this issue? Then I can merge you PR.