Any plans to enhance devices api to support...

Posted on
Sun Aug 09, 2015 1:53 am
srgoldman offline
Posts: 9
Joined: Sep 20, 2004

Any plans to enhance devices api to support...

1. Return only devices in a specified folder
2. Respect the show in remote UI setting and only return devices with that set

I can probably figure out how to make these changes directly in the server but would prefer a more sustainable approach. All suggestions welcome.

Posted on
Sun Aug 09, 2015 10:49 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Any plans to enhance devices api to support...

No plans for those types of changes, but you can easily do it yourself:

Code: Select all
someFolderId = indigo.devices.folders["Some Folder Name"].id
for dev in indigo.devices:
  if not dev.remoteDisplay or dev.folderId != someFolderId:
    continue  # skip this device
  indigo.server.log("found device: " + dev.name)

There is no reason the above technique is not sustainable.

Image

Posted on
Sun Aug 09, 2015 11:30 am
srgoldman offline
Posts: 9
Joined: Sep 20, 2004

Re: Any plans to enhance devices api to support...

Thanks Matt. I discovered that the devices.json API already does respect the "Show in Remote UI" setting so that seems sufficient for now.
As for the folders, where would you put that code so that it didn't get replaced when a new version of Indigo comes out?

Posted on
Wed Aug 12, 2015 3:01 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Any plans to enhance devices api to support...

Ah, you are using the RESTful API. I thought you were referring to the main Indigo scripting and plugin API.

The RESTful API does not currently support folders. That is, however, on our request/ToDo list.

Image

Posted on
Thu Aug 13, 2015 9:06 am
srgoldman offline
Posts: 9
Joined: Sep 20, 2004

Re: Any plans to enhance devices api to support...

Folders in the RESTful API would be great. I've also discovered some issues with the JSON implementation when dealing with unicode device/action names. I believe it's due to the underlying python library which seems a bit out of date but the bottom line is that the server is returning invalid JSON. Not critical, I switched to the XML version which appears to be more robust.

As far as folders go, even a simple: get_device_folders, get_actions_folders would be helpful since the device info identifies the folder by id, not name.

Posted on
Fri Apr 28, 2017 11:18 am
henkjanvries offline
User avatar
Posts: 108
Joined: May 05, 2012

Re: Any plans to enhance devices api to support...

Hi guys,

any news on the folder data via the restful api?

plus as the previous poster was commenting about, are the python libraries updated in v7.x ?

thanks!

Posted on
Fri Apr 28, 2017 12:34 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Any plans to enhance devices api to support...

Folders most likely won't be added until we do a major rewrite of the Indigo Web Server (which would give it access to the Python IOM), upon which the REST API is based. That's still a ways off.

Unclear what the previous poster was talking about, but we did correct some issues with json generation a while back.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests