Haiku setting flag values via URL with HH?

js19707

Active Member
is there a URL scheme available to set a flag to a specific value using HaikuHelper? in this case I'm looking to set a numeric value for temperature.
 
Sure, pretty much everything is available via a URL:

Code:
http://haikuhelper-server:9399/api/controller.userSettingWithName('yoursetting').setValue(80)

(Of course you will also need to include proper authentication).
 
thanks Lupinglade. two questions:

1) from the name, it appears this method sets the value for a user setting. that might work for me, but what i have right now is actually a flag. is there a corresponding method for flags?

2) re: authentication, is it possible to pass the relevant username and password in the query string for this request? i'm working with a simple device that doesn't have support for multiple HTTP requests so i've got to cram everything into one URL.
 
Oh yes, I was surprised because you wanted to set a "temperature", which flags usually don't handle. And yes, you can pass an HTTP auth into the URL, but it depends on whether the device you are using supports it.

Code:
http://user:password@haikuhelper-server:9399/api/controller.unitWithName('yourflag').setCounter(80)

You may also need to "URL encode" some characters, including characters in the user and password if the device is not able to do it for you. For example:

Code:
http://user:password@haikuhelper-server:9399/api/controller.unitWithName%28%27yourflag%27%29.setCounter%2880%29
 
Back
Top