toddmedema / echo

For controlling local devices with the Amazon Echo
207 stars 84 forks source link

bring in device name into example #4

Closed ebartz closed 7 years ago

ebartz commented 7 years ago

This makes the name of the device available. I kinda translate my current API for home automation in this way so i can use it with alexa:

if name is "foobar": if state: urllib2.urlopen("https://some_host/switch.php?id=foobar&cmd=1").read() else: urllib2.urlopen("https://some_host/switch.php?id=foobar&cmd=0").read()