neeoinc / neeo-sdk Goto Github PK
View Code? Open in Web Editor NEWNEEO Brain SDK
Home Page: https://neeoinc.github.io/neeo-sdk/
License: MIT License
NEEO Brain SDK
Home Page: https://neeoinc.github.io/neeo-sdk/
License: MIT License
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.
I was trying to use the alwaysOn
capability, but it seems that it's not being propagated to devices that are discovered.
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)
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 ...
Can you give us the option to mark a devices as always on so that we don't have to look at the stupid device screens all the time?
https://planet.neeo.com/t/k9kpj7
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
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
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.
Hi,
It would be great and very useful if you add list component to NEEO SDK
REf: React, Ionic, etc...
Best regards
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?
When I remove a device - I never get an unsubscribe callback
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
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?
Issue
CoS
Right now the SDK only supports Lights and Accessories. I like to add a TV and AVR as an IP controlled device and use the favorite and volume control functions like we can on the build in devices.
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.
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?
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..
It would be realy useful to be able to add custom widgets in stead of having to add multiple shortcuts to existing recipes.
Currently express is bundled with the SDK. This makes it hard to implement with an existing application.
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...
Apparently we can use magic strings right now. That needs to be formalized or have an API that specifically allows this.
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)
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.
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
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.
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.
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...
When updating a SDK driver (adding/removing capabilities) its currently not possible to chose update driver like with "real" drivers. A similar feature would be nice.
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".
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)
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
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.
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.
In addition to images types already posted:
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.
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
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Hi,
I am trying to implement a sensor in my driver however, the getter function doesn't seem to be ever called.
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:
Issue
lib/device/brain/index.js
and lib/recipe/index.js
both contains a buildBrainUrl function
COS:
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)
-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
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
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).
When sending a state update to a switch it only works. when providing false as a string and true as a boolean.
updateComponent(deviceId, 'toggle', 'false');
updateComponent(deviceId, 'toggle', true);
í Couldnt find the root cause.
Hello,
Discovered when building an Audio driver for SqueezeBox.
The slider position is not updated on the remote for an Audio Device.
Repro:
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.