Code Monkey home page Code Monkey logo

neeo-sdk's People

Contributors

enternoescape avatar greenkeeper[bot] avatar michaelkohler avatar neophob avatar nklerk avatar pfiaux avatar

Stargazers

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

Watchers

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

neeo-sdk's Issues

URL encoded capabilitie names.

The name value of capabilities get URL encoded, this results in a crash of the adapter when the capabilitie is used at the app or remote.

The device adapter and capabilities get delivered via json and wont need URL encoded names.

Missing URL decoding on adapter request from brain.

when the brain request the adapter handler, the request is URL encoded. the SDK doesnt decode this resulting in a crash.

When a device adapter is created with a name "POWER OFF"

The brain uses this URI to communicate with the handler.
GET device/apt-16c79afa417343dd0e30e775423a9ad70f82bda2/POWER%20OFF/default

the request is't decoded so the SDK cant find the handler.

Error: HANDLER_NOT_FOUND
   at errorHandler neeo-sdk\lib\device\express\routes\deviceroute.js:12:15)
   at neeo-sdk\lib\device\express\routes\deviceroute.js:30:5
   at paramCallback (express\lib\router\index.js:404:7)
   at param (express\lib\router\index.js:384:5)
   at paramCallback (express\lib\router\index.js:401:21)
   at neeo-sdk\lib\device\express\routes\deviceroute.js:24:3
   at paramCallback (express\lib\router\index.js:404:7)
   at param (express\lib\router\index.js:384:5)
   at Function.process_params (express\lib\router\index.js:410:3)
   at next (express\lib\router\index.js:275:10)
   at Function.handle (express\lib\router\index.js:174:3)
   at router (express\lib\router\index.js:47:12)
   at Layer.handle [as handle_request] (express\lib\router\layer.js:95:5)
   at trim_prefix (express\lib\router\index.js:317:13)
   at express\lib\router\index.js:284:7
   at Function.process_params (express\lib\router\index.js:335:12)

Support Text components

Feature Request

  • support text components, so the SDK can send any kind of text information to the NEEO Brain

CoS

  • option to create text components in the SDK
  • NEEO Brain can display those text elements on the mobile app and on the NEEO remote

ImageUrl behaviour on the remote

Hi,

I have noticed that the remote is refreshing the images every 30 seconds.
The issue however is that when looking at the logs on the driver, every refresh, I get 2 requests and for every request, it is downloading the image twice resulting in the image being downloaded 4 times every 30 seconds ...

Brain Discovery not working

Win10, 64-bit

When I run ANY example script - it get's stuck (never times out or finishes) trying to discovery the first brain (ie discoverOneBrain). I know discovery works on the machine because I can find the brain with bonjour browser, with dns-sd and with my own java sdk. The only thing that doesn't discovery it is the SDK.

BTW - for testing, I simply hardcode the IP address in brainIp but would like to get this resolved

Support custom widgets/controls

Since the controls/widgets are html based - would be nice to support management of custom widget/controls.

Example: a russound control would allow me to mimic the MyRussound app and could be used with a russound device

[feature request] Create widgets “grouping” some added controls

Hi

Actually we can add individual “controls” using SDK that latter we can add into a reciepe as a shortcut.
If you want to add a group added controls, in a certain order , you have to add latter one by one.
It will be great if we could "group" some added controls into a widget and so that later you can add a widget with all the controls.

Brain or SDK bug with device type LIGHT and multiple sliders

Origin: https://planet.neeo.com/t/x1zhs6/brain-or-sdk-bug-with-device-type-light-and-multiple-sliders

When adding a light with a power switch and a dimmer slider. these are added to the grouped recipe named light as: <on/off>

When adding a light with multiple sliders, (dimmer, hue, saturation, etc.) one of the sliders and the on/off switch is added to the grouped recipe. not necessarily the .I ended up with a <on/off> combination and another time with a <on/off> combination.

I'm not sure if this is caused by the Brain, Recipe or SDK so i included all these tags.

__

Can you tell me if this is SDK related, or should this go in JIIRA?

Improve API documentation

Issue

  • Current API documentation (based on doxdox) is hard to read, some workarounds are needed.
  • We could use another template or switch the doc generator completly

CoS

  • Improved API documentation, more readable

Records Button missing since last Update

Hey NEEO,
since the Last SDK Update, the Record Button went missing. I try to recode it, but it doesn't work.
.addButtonGroup('Record') - doesn't show the Record on the Remote or the App

Kind Regards
Markus

Starting with Node Docker image not working

I get an error: ERROR! BRAIN_NOT_REACHABLE

I used the simple Accessory as sample.

Docker is started with:

docker run --name=neeo-http -d --restart=on-failure:3 --net=host -p 3000:3000 -p 6336:6336 -v /volume1/docker/neeo-http:/usr/src/app -w /usr/src/app node:8.9.4 node index.js --loglevel=debug

Is there anything special needed for communication?

Brain Version Check

Issue

  • Currently the SDK does not check the Brain Version, it possible that future SDK version rely on newer Brain features.

CoS

  • check if the connected Brain is feasible to use with this SDK version

Virtual device POWER ON/OFF relation

How are the POWER ON and POWER OFF keys defined and used in the Brain?

If I define a new (virtual) device that has only a POWER ON and POWER SUSPEND virtual key, I notice that I can not use the Power icon on the remote to power off the recipe, it just stays in the GUI.

While in the recipe you are able to define the actions when pressing power on/off anyway, so why is this actually linked with these capabilities?

Off course I can easily fix this by changing the POWER SUSPEND key and name it POWER OFF but I like to understand what/why the software is behaving this way.

Data can't be blank

Mike - not necessarily a SDK issue but was hoping you can comment. I have a pandora streaming device that I've created a text label to represent the currently playing album name. However, when pandora goes to a commercial - the album name becomes blank (empty string). The notification going to the brain is this:
{"type":"6273219938429698048:russound_source_26e9bb26_2_albumname","data":""}

However - I get the following error message back:
{"message":"Validation failed: {"data":["Data can't be blank"]}","error":{}}

Is that correct? Can we really not send a blank to a text label (to clear it out)?

Now that I think about the SDK - does it convert a blank to a "-" to get around this?

Image button

Now that we have images and buttons - any chance we can get an image button?

Example: let say I'm putting together a DIAL plugin. DIAL will give me (among other things) the the application URL and the image URL. I'd like to expose this to NEEO as a series of image buttons - where button shows the application's image URL and pressing the button will trigger off the applications URL. So on the remote - it will show the NETFLIX image, the AMAZON image, etc - and pressing one of those starts the application on the DIAL device..

Decouple Express from SDK

Issue

Currently express is bundled with the SDK. This makes it hard to implement with an existing application.

CoS

  • remove express dependency from SDK
  • provide express middleware
  • update examples

TextLabel option

I know you just fixed it so that the label on the textlabel shows on the remote but can we have an option on text labels to NOT include the label by default (like it was prior to the fix but on a textlabel by textlabel basis)?

Use case: music - would be really nice to show just the album name not "Album Name: xxx". Likewise there are text labels that act more like titles - so I'd want something showing "Pandora" or "Spotify" or "DLNA" and not "Source: Pandora", "Source: Spotify", etc...

Disabled capabilities

There should be a way to disable the capability actor (both at definition time and during runtime). Example: a complex device may have a switch that is only valid under certain circumstances - having an API to enable/disable the switch would help to visually represent the state of the device (same applies to buttons and sliders)

Bug in routing

From express/server.js - you set the routes like
'/db' - routeDatabase
'/device' - routeDevice
'/' - routeDeviceRegistration

'/db/search' for device search
'/db/{0}' where device definition

'/device/xxx' - device discovery/set/get values

'/xxx' - adapter subscription

The problem really occurs with the last one - where 'xxx' is defined as '/:adapterName/yyy'

What if I was very bad and decided to name my adapter "db" or "device"?!? Routing would get really screwed up since I was able to match a different route. Same goes if you change the device ID to a string - then I could have a device id of "search" and screw that part up.

The routes should be more explicit - something like
'/db/search'
'/db/get'
'/device/discovery/xxx'
'/device/get/xxx'
'/device/set/xxx'
'/device/subscribe/xxx'
'/device/unsubscribe/xxx'

That way they 'dynamic' part of the route can't screw up your routing.

Not Using correct Adapter Base IP

The ipHelper uses the first non internal IPv4 Address which then is used to generate the Adapter BaseURL. So there might be cases, when this does not work. Multiple NIC's, inside Docker Container.

I created a possible fix for this. See #57

CURSOR ENTER/OK button does not trigger event when setType('DVD')

Discovered while creating custom device definitions for serial-controlled devices in my home theatre.

The CURSOR ENTER event does not fire for either .addButton({name: 'CURSOR ENTER'}) nor .addButtonGroup('Controlpad'). As soon as I switched to .setType('MEDIAPLAYER') with no other changes, the button resumed working just fine.

Persist SDK Information on NEEO Brain

Issue

Currently no data is persisted when a SDK device is added to the NEEO Brain. If the NEEO Brain restarts, the SDK needs to be restarted. Then the SDK will register on the Brain and the Brain knows the SDK again.

CoS

  • after a NEEO Brain restart, the SDK must not restarted be be usable

Component Look and Feel

In addition to new widgets/components, would be nice to have variants to existing components. Example - a switch could be represented as a toggle or could be represented as a push button.

If you wanted to go more general - would be nice to specify our own look and feel to each component...

addSwitch(): setter called with newValue being a string instead of a boolean

I added a switch to a device as described in the SDK documentation:
.addSwitch( { name: 'example-switch', label: 'my switch' }, { setter: (newValue) => switchState = newValue, getter: () => switchState ) } )
When I press the this switch the setter function is called with newValue as an argument. As the switch can only be on or off I would expect newValue to be a boolean but it seems to be a string with the value "true" or "false".

JSON messages

Beyond needing to properly document the JSON message format between the brain/sdk, I'd like to bring up one issue with the capabilities format - the 'path' attribute. The 'path' is really more about the SDK routing and not really about the capability itself - and really shouldn't be part of the message format because of that (plus you're combining capability definition with routing information [you could argue they are the same - but it's a bit of a week argument).

I'd rather see the 'path' attribute replaced with a [string] ID attribute (the identifier of the capability). Then have a well known path like '/device/[id]/xxx' documented as the callback (for get/set)

Subscribe/Unsubscribe Capabilities

I really like that the SDK will subscribe/unsubscribe from the device. However, for complex devices there needs to be a way to subscribe/unsubscribe from each capability.

Example: let's say I have a complex device with say 50 capabilities. Of those 50, only 10 are general and the other 40 are 'advanced' use (ie think about the 'unpair' on apple tv - won't be used often). Now - some of those 40 may be resource intensive and we don't want to start up those notifications unless we know they will be used.

What would be nice is if the capability is used (in a recipe or shortcut), the brain will 'subscribe' to those capabilities (like it does the device) and 'unsubscribe' if removed

[feature request] sensor device type

Hi,

I am making a doorbell driver and it would be nice if I could start the device recipe when someone rings on the door ...
The only way I can see that working so far would be to have the possibility of creating a sensor device that would trigger the recipe.

Support directory listing components

This is a feature request for a directory browsing component so the device adapter can provide a list with items that the end user can browse through. this can be used for many things but especially usefull for browsing through media content.

Support more components

In addition to images types already posted:

  1. Support for spinners (date, number)
  2. Support for text entry (either a popup keyboard like phones or a alphanumeric spinner like russound)

An in-range update of sinon is breaking the build 🚨

Version 4.1.6 of sinon was just published.

Branch Build failing 🚨
Dependency sinon
Current Version 4.1.5
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 10 commits.

  • 68c37ed Update docs/changelog.md and set new release id in docs/_config.yml
  • cd8ae51 Add release documentation for v4.1.6
  • 29e80be 4.1.6
  • a5c59a5 Update History.md and AUTHORS for new release
  • 0ae60b6 Merge pull request #1653 from mroderick/upgrade-dependencies
  • dcd4191 Upgrade browserify to latest
  • a316f02 Upgrade markdownlint-cli to latest
  • 78ebdb3 Upgrade lint-staged to latest
  • fcf967b Upgrade dependency supports-color
  • 7c3cb4f Enable StaleBot with default configuration (#1649)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

sensor behaviour

Hi,
I am trying to implement a sensor in my driver however, the getter function doesn't seem to be ever called.

[Feature Request] Support Favorites for SDK devices

I would like the ability to dynamically add & remove buttons from a device. Currently I have to restart the node server & rebuild the device. I would like to be able to do this on the fly while the server is running.

The reason for this is to accommodate Devices such as a Roku where channels can be added & removed dynamically. I would like to be able to periodically poll the channel listing from my node service and update the available channels as buttons available to the NEEO without restarting the driver & re-creating the device.

(edited) status:

  • Favorites as callbacks from the Brain, without custom source or list.
  • Expose custom favorite search results to the Brain
  • Favorites not managed on Brain

Support Image Components

Feature Request

  • support image components, so the SDK can send any kind of image information to the NEEO Brain

CoS

  • option to create image components in the SDK
  • NEEO Brain can display those image elements on the mobile app and on the NEEO remote

remove duplicate buildBrainUrl

Issue
lib/device/brain/index.js and lib/recipe/index.js both contains a buildBrainUrl function

COS:

  • remove duplicate function, only one buildBrainUrl function

When a driver is removed from the NEEO brain while the SDK isn't availeble the SDK code will crash next time it starts.

In regards, to #11 here is a proper issue submision.

When a driver is removed from the NEEO brain while the SDK isn't availeble, the SDK code will crash next time it starts with an unhandled exception.

Unhandled exception has occurred: Error
Error: COMPONENTNAME_NOT_FOUND
    at BrainNotificationMapping._findNotificationKey.Promise (...\neeo-sdk-examples\node_modules\neeo-sdk\lib\device\brain\notificationMapping.js:52:12)
    at module.exports.BrainNotificationMapping._findNotificationKey (...\neeo-sdk-examples\node_modules\neeo-sdk\lib\device\brain\notificationMapping.js:32:10)
    at BrainNotificationMapping.getNotificationKey.componentName._fetchDataFromBrain.then (...\neeo-sdk-examples\node_modules\neeo-sdk\lib\device\brain\notificationMapping.js:67:19)
    at process._tickCallback (internal/process/next_tick.js:109:7)

To reproduce this issue follow these steps:

-Start the discoverable device example.
-Add the PRO device that is reachable (unique-device-id-001)
-Add all the components of the device as shortcuts and see the values changing by the example code.
-Stop the example SDK code.
-Remove the discoverable device from the neeo
-Start example script again. You will get the Unhandled exception has occurred: Error

[Feature Request] Add callback at the end of discovery process and just after user select desired device.

The function registered with registerInitialiseFunction is called too late and in some situations it is necessary to perform an action (example loading data for configuration) when the user selects the device after the discovery process.

.registerAfterDiscoveryFunction(controller.afterDiscovery)

// Example code in the controller:
module.exports.initialise = function() {
debug('call api and load some data from home automation device');
// dynamically add switches or buttons
};

Regards

Support for scenario creation

Again - using russound as an example. Would be nice to able to define a 'Listen to Music' scenario that would startup a device automatically in a specific room (russound zone).

Slider is not updated on the Remote (Audio Device)

Hello,
Discovered when building an Audio driver for SqueezeBox.
The slider position is not updated on the remote for an Audio Device.

Repro:

  • Add an Audio Device with a slider.
  • Updates the slider value.
  • On the NEEO App, slider is at the correct position.
  • On the Remote slider stays at 0.

BTW, the documentation of the slider does not reflect the SDK implementation. The setter value is the second parameter, the first value is a strange "default" string.

Input fields

Could we get inout fields so that users can enter data during the setup or when configuring a device from within the neeo app? Would be much user friendlier if they could enter things like logins, ip's, authentication codes and so on without having to go change the actual code.

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.