Giter VIP home page Giter VIP logo

smartthings-node's People

Contributors

hijha avatar jayhjha avatar lounsbrough avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

smartthings-node's Issues

TypeError: smartthings is not a constructor

Node version: v10.9.0

I used the CommonJS version:

var smartthings = require('smartthings-node');
var st = new smartthings("MY-PERSONAL-ACCESS-TOKEN");

st.devices.listDevicesByCapability('switch')
    .then(deviceList => {
        console.log(deviceList);
    });

The full error message:

TypeError: smartthings is not a constructor
    at Object.<anonymous> (/MY-APP-DIR/app.js:52:10)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)

npm install not working any more

pi@retropie:~/git/Bticino_smartthings $ npm install smartthings-node
npm WARN deprecated [email protected]: request has been deprecated, see https://git hub.com/request/request/issues/3142
npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR! at /usr/share/npm/lib/cache/add-named.js:120:12
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.j s:167:7)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 4.9.35-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "smartthings-node"
npm ERR! cwd /home/pi/git/Bticino_smartthings
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm WARN deprecated [email protected]: request-promise has been deprecated b ecause it extends the now deprecated request package, see https://github.com/req uest/request/issues/3142
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/git/Bticino_smartthings/npm-debug.log
npm ERR! not ok code 0

.

.

Some apis on smartthings-node do not support apptoken parameter,

According to my initial check, some apis don't suppport apptoken as a parameter.

listDevicesByDeviceId(deviceId) { //<= no token parameter
    let queryParams = { deviceId: deviceId };
    return this.listDevices(queryParams);
}
listDevices(queryParams, smartAppToken) { //<= has token parameter, but it can not be used by listDeviceByDeviceid
    let authToken = this.getAuthToken(smartAppToken);
    return requestbuilder_1.default(authToken, 'devices', 'GET', queryParams);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.