IndigoServer and Scriptbridge

Posted on
Mon Nov 11, 2013 1:14 pm
dscottbuch offline
Posts: 90
Joined: Jan 19, 2004

IndigoServer and Scriptbridge

I looked through the forums and didn't see anything on this. Has anyone put together the .h file to support IndigoServer and the ScriptBridge in Cocoa/ObjC ?

Thanks,
scott

Posted on
Mon Nov 11, 2013 2:46 pm
jay (support) offline
Site Admin
User avatar
Posts: 18255
Joined: Mar 19, 2008
Location: Austin, Texas

Re: IndigoServer and Scriptbridge

I don't think so - I'm not even sure the script bridge is being developed or supported by Apple any more. We haven't expanded Indigo's AppleScript implementation since Indigo 4; rather, we recommend using our Python-based scripting instead.

To control Indigo via a Cocoa application, a better idea would be to just use the RESTful API with the standard Cocoa HTTP APIs. That's what developers of other products are using.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Nov 18, 2013 3:12 pm
dscottbuch offline
Posts: 90
Joined: Jan 19, 2004

Re: IndigoServer and Scriptbridge

Apparently my last reply didn't get posted. Scriptbridge is alive and well and will likely stay around until iTune is re-done without applescript. I'm using it in another project for getting stuff from TiVo's (https://github.com/dscottbuch/ctivo).

In any case I've used the Rest API to get the information I need and now I I'm replicating my applescript irrigation script in python. In applescript I was able to create temporary actions each day to carry out the daily watering schedule
Code: Select all
         if ezflag then
            set ezaction to make new time date action with properties {date trigger type:absolute, absolute trigger time:((current date) + del), auto delete:true, name:"_EZRainBack_Schedule"}
            --set date trigger type of ezaction to absolute
            --set absolute trigger time of ezaction to ((current date) + del)
            --set auto delete of ezaction to true
            set zact_step to action step 1 of ezaction
            set action type of zact_step to controlSprinkler
            set device name of zact_step to "EZRainBack"
            set sprinkler action of zact_step to runSchedule
            set zone durations of zact_step to zone_times
            --set absolute trigger time of ezaction to ((current date) + del)
            --set name of ezaction to "_EZRain_Schedule"
         end if


I've found the schedule item in the IOM in python and it seems to have the same properties (for which I can infer the mapping) but they all seem to be read-only. For example if I do

Code: Select all
>>> s = indigo.schedule.create("mytest","This is a test")
>>> s.autoDelete = True
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: the attribute "autoDelete" is read-only on this instance
>>>


Which seems to be true for most properties. Is there something I'm missing. If I change the properties in the Server and the refreshFromServer they're reflected properly.

scott

Posted on
Mon Nov 18, 2013 3:17 pm
matt (support) offline
Site Admin
User avatar
Posts: 21426
Joined: Jan 27, 2003
Location: Texas

Re: IndigoServer and Scriptbridge

Hi Scott,

The Indigo model/API for the schedule objects is incomplete, so for that you'll need to fallback to using AppleScript for the time being.

Image

Posted on
Mon Nov 18, 2013 4:27 pm
dscottbuch offline
Posts: 90
Joined: Jan 19, 2004

Re: IndigoServer and Scriptbridge

OK. Thanks. I'll put this project on hold for now. Any timeline?

Posted on
Mon Nov 18, 2013 5:36 pm
matt (support) offline
Site Admin
User avatar
Posts: 21426
Joined: Jan 27, 2003
Location: Texas

Re: IndigoServer and Scriptbridge

It is definitely on my ToDo list and will get done, but not near the top. So no realistic ETA yet.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest