Open barnabycourt opened 7 years ago
Thanks @barnabycourt for your input.
Can you explain what roku channels are and how you plan to use it? it looks like an "app" on the apple tv - how you can select such a channel?
BR
@neophob These are very much like "apps" on apple tv. Someone can add a new channel/app via the roku search and then the next time neeo driver can retreive the updated app list and create new favorite's buttons for each app.
I see - something like the current favorite channels you can choose (tv or dvb)
Exactly, When I query the Roku I get a list of all the available apps/channels (amazon, Netflix, Hulu, etc.) I want to dynamically create buttons for each app
+1 I also definitely need this feature
I finishing a driver to handle the scenes on Fibaro Home Center 2 & Lite (Home automation box) and i would like to be able to added and removed dynamically buttons / switches.
Regards
Just to be sure for the Roku use case, so you can request this list of apps/channels. each of this list items have something like a unique id that can be sent to roku and that item will be activated?
Example:
curl http://192.168.1.134:8060/query/apps
)
<apps>
<app id="11">Roku Channel Store</app>
<app id="12">Netflix</app>
<app id="13">Amazon Video on Demand</app>
<app id="14">MLB.TV®</app>
<app id="26">Free FrameChannel Service</app>
<app id="27">Mediafly</app>
<app id="28">Pandora</app>
</apps>
curl -d '' 'http://192.168.1.134:8060/launch/11?contentID=12'
)that would be the complete example, right?
That is correct. The full details of the Roku API can be found at https://sdkdocs.roku.com/display/sdkdoc/External+Control+API#ExternalControlAPI-query/appsExample. For reference, I am using the nodeku library for discovery & app launching in my particular driver: https://github.com/barnabycourt/neeo_driver_roku
Copied from beta section: https://planet.neeo.com/t/q553a9
I have written a DVB driver, for the Netherlands i would like to expose a set of default favorites (e.g. channels of Dutch television); would be cool if there was a 'setupFavorites' mapping in the deviceBuilder with channel name (and/or logo) and number for example.
Same goes for shortcuts btw, a custom driver might want to give a head-start to a user.
Does this fall into this feature request?
absolutly
Thanx @neophob would be even cooler if the device driver would be able to dynamically change the favorites, e.g. depending on time of day a childrens channel might not be 'on air'.
Yes I see multiple use cases:
and so on
As discussed in https://github.com/NEEOInc/neeo-sdk/issues/123 the favorite feature should be flexible to accommodate different scenarios:
The API might then look like
.enableFavorites({
useDefaultSearch: true, // enable/disable the default search results
customSearch: (query) => {...} // optional some callback to search
useChannelNumbers: true, // disable to use only ids
// user can add favorites but no need to manually assign numbers?
customFavorites: () => {...} // optional if used fetches favorites from driver, instead of Brain
// this would also need a sensor to track if they change and refresh on Brain
favoriteHandler: (id) => {...} // Callback when a favorite is called with id or channel number as string.
})
First version of this feature will only cover the favorite handler callback (search and get/set will still be done on the Brain). Most likely this will be the API:
.registerFavoriteHandlers({
execute: (deviceId, channelNr) => { ... },
});
So if a favorite on the Brain for channel 42 is called the channelNr
will be '42'
allowing the SDK implementation to split, delay, add pre/postfix commands as needed. The Brain wont send DIGIT 4
and DIGIT 2
button commands anymore if this is enabled for that device.
@pfiaux Sounds nice, will the channel number be validated as number? or can it also be annother action (script, url-call, callback, ...). As far as i understand your posting, this means, only the available (currently in NEEO Favorites DB) stored Images will be accessible and must be user defined, or can this also be done via SDK?
Or does this only send the "user defined Numbers" back to the SDK to let the SDK handle the Commands (e.g. User gets favorites CH30, NEEO doesn't send IR Commands but calls SDK "FAV30" is pressed, and SDK can handle NEEO Send TCP/IP 3, TCP/IP 0 TCP/IP Enter) or any other thing like open app Netflix.
Sorry if i don't get it. Hope one Day this is full flexible also with providing Channel Logos through the SDK and Custom Commands in background and expose this to the NEEO as "Favorites Page" So you can display a list of recordings with Pictures or something like that ;-) (i know that this is not the intention of the Favorites Page, but until the Listview can be selected as Page on NEEO)
Currently the channel number will be the numbers defined in the app by the user when adding the favorites, which allows numbers and some separators, however no script/url at the moment. Here's some examples for a favorite to channel 42:
Currently:
With new optional handler:
That's the first part of the feature. Possible future steps as outlined above could be:
@pfiaux nice one, however the api is now different between the button handler and the favorite handler, is that correct? pseudo implementation:
.addButtonHandler((button, serialNumberOrUniqueId) => {
MediaboxManager.ButtonPressed(serialNumberOrUniqueId, button);
})
.registerFavoriteHandlers({
execute: (serialNumberOrUniqueId, favoriteId) => {
MediaboxManager.FavoritePressed(serialNumberOrUniqueId, favoriteId);
}
})
@Webunity that looks right, button has had the parameters flipped for backwards compatibility reasons that remains. Most other callbacks will use deviceId first.
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: