Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script support #25

Closed
ggrip opened this issue Aug 12, 2015 · 5 comments
Closed

Script support #25

ggrip opened this issue Aug 12, 2015 · 5 comments
Assignees

Comments

@ggrip
Copy link

ggrip commented Aug 12, 2015

Arm,

 Firstly, thanks for this amazing piece of software.  I now have all my lights talking to Alexa.  So, to my

request; as I don't know Java, I really can't help with this, but it would be nice to have a drop down that
let you put in local scripts instead of URLs for on and off. I use a mix of Wemo and Lifx bulbs and
neither have a RESTful interface that I can use with your software (Lifx's RESTful interface requires you
to POST or PUT instead of a GET). Again, not really an issue, but more of an enhancement request.
Thanks again.

Dan-

@maddox
Copy link

maddox commented Aug 12, 2015

RESTful interface requires you to POST or PUT instead of a GET

It would be nice if we could have the option to provide the HTTP method for the URL.

I too have some of my own custom software that I have amazon-echo-ha-bridge pointing at and had to make my URL endpoints GETs. I'm not very comfortable with this, as GET urls are easy to hit and these URLs are pointing at potentially important things. I'd prefer they be POSTs or PUTs. If anything, it's more compliant with a REST system.

If anything, it'd be nice the default was POST.

@armzilla
Copy link
Owner

I agree. I was initially worried/lazy about the difficulty of creating
templates for the post/put body nor had any use case that required a
different http method . Should be an easy add. Should be in the next
release this week.

On Wed, Aug 12, 2015, 12:23 Jon Maddox notifications@github.com wrote:

RESTful interface requires you to POST or PUT instead of a GET

It would be nice if we could have the option to provide the HTTP method
for the URL.

I too have some of my own custom software that I have
amazon-echo-ha-bridge pointing at and had to make my URL endpoints GETs.
I'm not very comfortable with this, as GET urls are easy to hit and these
URLs are pointing at potentially important things. I'd prefer they be POSTs
or PUTs. If anything, it's more compliant with a REST system.

If anything, it'd be nice the default was POST.


Reply to this email directly or view it on GitHub
#25 (comment)
.

@maddox
Copy link

maddox commented Aug 12, 2015

Should be in the next release this week

Nice!! Thanks!

@armzilla armzilla self-assigned this Aug 12, 2015
@armzilla
Copy link
Owner

added in 28ba226

@armzilla
Copy link
Owner

please try out in the preview v0.2.1 release. create a new device

{
"name": "test device",
"deviceType": "switch",
"offUrl": "http://192.168.1.201:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&DeviceNum=31",
"onUrl": "http://192.168.1.201:3480/data_request?id=action&output_format=json&DeviceNum=31&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=${intensity.percent}",
"contentType" : "application/json",
"httpVerb":"POST",
"contentBody" : "{"fooBar":"baz"}"
}

note the escape of quotes in the content body. currently no validation of the content type, invalid content types WILL explode!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants