Git Product home page Git Product logo

nodeku's People

Contributors

barnabycourt avatar bschlenk avatar esetnik avatar glavin001 avatar sgnl avatar

Stargazers

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

Watchers

 avatar  avatar

nodeku's Issues

Roku TV is not discovered with SSDP

Running the following always times out

const Nodeku = require('nodeku')

console.log('Looking for devices...');
Nodeku()
  .then(device => {
    console.log(`Device found at: ${ device.ip() }`)
    // 'xxx.xxx.xxx.xxx:8060'
    return device.apps()
  })
  .then(apps => {
    apps.forEach(app => console.log(app))
    // [{ id, name, type, version }, ...]
  })
  .catch(err => {
    console.error(err.stack)
  })

Logs

Error: Could not find any Roku devices. Time spent: 10 seconds

Info

Roku TV
Roku version: 7.7.0

Related to #7

Roku TV ECP commands

unsure if i should implement:

  • query/tv-channels
  • query/tv-active-channel
  • launch/tvinput.dtv

Tests aren't being run

I wrote a test for a pull request and realized it should have been failing, but it wasn't. The wrapper code that everything uses never actually runs the tests :P

This:

function wrapper(description) {
  test(description, async t => {
    const device = await Nodeku();
    t.truthy(device);
  });
}

should be this:

function wrapper(description, func) {
  test(description, async t => {
    const device = await Nodeku();
    t.truthy(device);
    func(t, device);
  });
}

I would send a pull request, but updating it causes a few of the existing tests to fail.

Implement mvp methods

  • .ip()
  • .apps()
  • .activeApp()
  • .info()
  • .keypress('key')
  • .keydown()
  • .keyup()
  • .icon()
  • .launch()

notes:

Device Module Api {
  ip: Fn() => 'xxx.xxx.xxx.xxx:8060'
  apps: Fn() => [{  ...appInfo  }, ...]
  activeApp: Fn => { ... }
  keydown: Fn(key) => POST to device only
  keyup: Fn(key) => POST to device only
  keypress: Fn(key) => POST to device only
  launch: Fn(AppId) => POST to device only
  info: Fn() => xml2js
  .icon: Fn(appId) => Binary data | img
}

this._timeout undefined

Using the provided sample code:

const Nodeku = require('nodeku')

Nodeku()
  .then(device => {
    console.log(`device found at: ${ device.ip() }`)
    // 'xxx.xxx.xxx.xxx:8060'
    return device.apps()
  })
  .then(apps => {
    apps.forEach(app => console.log(app))
    // [{ id, name, type, version }, ...]
  })
  .catch(err => {
    console.error(err.stack)
  })

I receive the following error:

/xxx/node_modules/nodeku/lib/discovery.js:8
  timeout = timeout || this._timeout || 10000;
                           ^

TypeError: Cannot read property '_timeout' of undefined
    at module.exports (/xxx/node_modules/nodeku/lib/discovery.js:8:28)
    at Object.<anonymous> (/xxx/roku.js:3:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:504:3

Why immutable.js?

I don't really see the point in making the responses immutable. There is no performance gain to be had by doing this, and it makes dealing with the lists and maps a bit quirky as they don't behave like standard js objects. Anybody using this api should already know that the responses are readonly.

update tests to work with env variables

instead of having this hack:

  if (MockReq) {
    Req = MockReq
  }

and

    if (this.hasOwnProperty('MockSSDPClient')) {
      Client = new this.MockSSDPClient()
    } else {
      Client = new NodeSSDPClient()
    }

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.