Page 1 of 1

Any plans to enhance devices api to support...

PostPosted: Sun Aug 09, 2015 1:53 am
by srgoldman
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.

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

PostPosted: Sun Aug 09, 2015 10:49 am
by matt (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.

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

PostPosted: Sun Aug 09, 2015 11:30 am
by srgoldman
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?

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

PostPosted: Wed Aug 12, 2015 3:01 pm
by matt (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.

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

PostPosted: Thu Aug 13, 2015 9:06 am
by srgoldman
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.

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

PostPosted: Fri Apr 28, 2017 11:18 am
by henkjanvries
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!

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

PostPosted: Fri Apr 28, 2017 12:34 pm
by jay (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.