-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected token ? in contorllers/tv_controller.js:58 #19
Comments
Hi @drewklein20 I have tested the below basic switch sketch and seems to work without a problem. Can you provide more details? example code perhaps ` const appKey = ""; // d89f1***----******** function setPowerState(deviceid, data) { const callbacks = { const sinricpro = new SinricPro(appKey, deviceId, secretKey, true); SinricProActions(sinricpro, callbacks); setInterval(() => { |
Sure thing. Here is my code, also I'm running node v10.24.0 `const { const appKey = "XXX"; function setPowerState(deviceid, data) { const callbacks = { const sinricpro = new SinricPro(appKey, deviceId, secretKey, true); SinricProActions(sinricpro, callbacks); setInterval(() => { // https://github.com/sinricpro/nodejs-sdk/blob/master/examples/simple-example/simple-example.js` |
Likely ?? not supported in your nodejs version. I am on v14
…On Fri, 12 Nov 2021 at 9:49 PM drewklein20 ***@***.***> wrote:
Sure thing. Here is my code, also I'm running node v10.24.0
`const {
SinricPro,
SinricProActions,
raiseEvent,
eventNames,
SinricProUdp
} = require("sinricpro"); // Use require('sinricpro'); if you are using NPM
const appKey = "XXX";
const secretKey = "XXX";
const device1 = "XXX";
const device2 = "";
const deviceId = [device1];
function setPowerState(deviceid, data) {
console.log(deviceid, data);
return true;
}
const callbacks = {
setPowerState
};
const sinricpro = new SinricPro(appKey, deviceId, secretKey, true);
SinricProActions(sinricpro, callbacks);
setInterval(() => {
raiseEvent(sinricpro, eventNames.powerState, device1, { state: "On" });
}, 2000);
//
https://github.com/sinricpro/nodejs-sdk/blob/master/examples/simple-example/simple-example.js`
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZAZZXXIT4WRFPYWOXTPC3ULUSQZANCNFSM5HV42CRQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Updating now! |
Thanks @kakopappa, looks like updating node worked. Currently on v16.13.0 and it's working great. @kakopappa maybe a good idea to add minimum node version supported with this package. |
`/home/pi/alexa/node_modules/sinricpro/lib/contorllers/tv_controller.js:58
const channel = payload.value.channel.name ?? payload.value.channel.number;
^
SyntaxError: Unexpected token ?
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/home/pi/alexa/node_modules/sinricpro/lib/cbhandler.js:15:40)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)`
The text was updated successfully, but these errors were encountered: