dansays / homebridge-applescript

Applescript plugin for homebridge: https://github.com/nfarina/homebridge
20 stars 8 forks source link

Stateless applescript #9

Open flyingartichoke opened 7 years ago

flyingartichoke commented 7 years ago

Is it possible to configure the applescript as a "stateless" switch?

I'd like to be able to just call a script and have it run once, rather than define separate on and off scripts. Currently I do this by creating a blank script for the "off" transition and I have a dummy switch which I use in HomeKit to turn off the Applescript switch as soon as it turns on. This works OK, but it'd be really nice to not have to create an extra switch and multiple automations for every Applescript accessory.

An example of where I would like to use this is I have an Applescript which creates a playlist with a random album from my iTunes library. There's no corresponding "off" behavior, and no reason for the switch to stay "on" in HomeKit.

This is already being done in the homebridge-http-simple-switch plugin, so hopefully the same could be done here?

raphtabe commented 5 years ago

+1 A push button with only one script linked would be great !