This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'net/http' | |
| require 'json' | |
| # Remember to enable control using JSON in HS | |
| HS_IP_ADDRESS = '192.168.1.201' | |
| HS_PORT = 80 | |
| HS_DEVICE_REF = 146 | |
| HS_DEVICE_STATUS_ON = 255 # Will toggle between these | |
| HS_DEVICE_STATUS_OFF = 0 # Will toggle between these | |
| LOG_FILE = 'zw-ping.log' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ViewController: NSViewController, NSSpeechRecognizerDelegate { | |
| var speech = NSSpeechRecognizer.init() | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| speech.commands = ["Fill form", "Follow link","NHS","A&E"] | |
| speech.listensInForegroundOnly = false |