Need some help with loadurl result

Philippe SCHMUCK philippe-schmuck at orange.fr
Sat Jul 28 10:31:52 EDT 2018


Ok, so I now have the second question: to turn ON the light, I need to send a PUT as stated in the joined file.
How can I do this inside XTension?

Philippe

> Le 28 juil. 2018 à 16:04, James Sentman <james at sentman.com> a écrit :
> 
> I think in both cases you’re just leaving off the “//“ between the http: and the address. Since both Curl and XTension, which uses the curl library internally to make the same call, are returning the same error I suspect thats all it is.
> 
> Add those in and see what happens. I joined their developer program a long time ago but haven’t done any serious work towards a plugin. I love their lighting panels though they are really cool so I would be happy to work on that with you. 
> 
> 
> 
> 
>> On Jul 28, 2018, at 9:55 AM, Philippe SCHMUCK <philippe.schmuck at wanadoo.fr> wrote:
>> 
>> loadurl "http:192.168.1.141:16021/api/v1/MyToken/state/on" callback handler "resultCatcher"
>> 
>> on resultCatcher(theResult, theData)
>> 	write log "result code=" & theResult
>> 	write log "data=" & theData
>> end resultCatcher
>> 
>> I get this, which seems not right:
>> 28/07/2018 15:51:14  result code=3
>> 28/07/2018 15:51:14  data=
>> 
>> as it seems to be the same result when doing this :
>> 
>> do shell script "curl -m 15 http:192.168.1.141:16021/api/v1/MyToken/state/on"
>> 		—> error "curl: (3) Port number ended with '.'" number 3
>> 
> 
> Thanks,
>  James
> 
> 
> James Sentman                       http://www.PlanetaryGear.org		http://MacHomeAutomation.com
> 
> 
> 
> 
> _______________________________________________
> XTensionList mailing list
> XTensionList at machomeautomation.com
> http://mail.machomeautomation.com/mailman/listinfo/xtensionlist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20180728/d6e4a479/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture d?e?cran 2018-07-28 a? 16.29.48.png
Type: image/png
Size: 38396 bytes
Desc: not available
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20180728/d6e4a479/attachment.png>


More information about the XTensionList mailing list