nlrb / bsh-api

NodeJS interface for the Bosch Siemens Home-Connect API.
Apache License 2.0
9 stars 2 forks source link

execute call #2

Closed bwired-nl closed 6 years ago

bwired-nl commented 6 years ago

Im getting this error hope you can help.... thanks

async _executeCall(api, params, body) { ^^^^^^^^^^^^

SyntaxError: Unexpected identifier at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:374:25) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Module.require (module.js:354:17) at require (internal/module.js:12:17) at Object. (/home/knuvihs/wired/_develop/homeconnect/home-connect.js:3:13) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10)

nlrb commented 6 years ago

Have a look at #1. You’ll need a recent version of NodeJS for async/await.

bwired-nl commented 6 years ago

thanks!! i got further now but now i have this, looks like a auth problem on homeconnect but expecting not an error...

https://developer.home-connect.com/security/oauth/authorize?client_id=2239DA12410650871D1836B36DDA734736A9A55D7A3A28B1B20E505692F082&redirect_uri=https://apiclient.home-connect.com/o2c.html&response_type=code&scope=IdentifyAppliance Monitor *-Control Settings&state=250da41b-f9ea-400c-ba17-68ab50ddb74c Error: Invalid response 403 at Request.request.get.on.on (/home/knu/wired/homeconnect/index.js:103:20) at Request.emit (events.js:160:13) at Request.onRequestResponse (/home/knu/node_modules/request/request.js:1068:10) at ClientRequest.emit (events.js:160:13) at HTTPParser.parserOnIncomingClient (_http_client.js:548:21) at HTTPParser.parserOnHeadersComplete (_http_common.js:115:23) at TLSSocket.socketOnData (_http_client.js:439:20) at TLSSocket.emit (events.js:160:13) at addChunk (_stream_readable.js:269:12) at readableAddChunk (_stream_readable.js:256:11)

bwired-nl commented 6 years ago

Upgraded account to advanced, but still above error...

nlrb commented 6 years ago

Simulator API endpoint was changed. Updated the code, thanks.

bwired-nl commented 6 years ago

Ok working thanks:-) working on on the simulator. Final question: can you help me pointing out the real api settings do i need to change these?

this.baseUrl = url || 'https://simulator.home-connect.com' this.redirect = redirect || 'https://apiclient.home-connect.com/o2c.html'

I tried setting it to https://api.home-connect.com Thanks!

nlrb commented 6 years ago

Sorry, forgot to sync the code change - done now.

You don't need to update the code. The url is a parameter when creating the class, so set it there.

"API of physical home appliances (access limited to select partners - stay tuned for the public release)"

nlrb commented 6 years ago

Looks like they are opening it up, physical device access: 'https://api.home-connect.com/api/' See https://developer.home-connect.com/?q=docs/api/general/endpoints_dataencoding

bwired-nl commented 6 years ago

I thought the production API was also open, but still not I guess :-( I send them a mail to ask when it opens up. taking to long now :-( All is working again on the simulator thanks for the great code! keep you posted