This file contains 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
import Foundation | |
struct Welcome: Codable { | |
let greeting: String | |
let instructions: [InstructionElement] | |
} | |
enum InstructionElement: Codable { | |
case instructionClass(InstructionClass) | |
case string(String) |
This file contains 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
#!/bin/bash | |
# Bash script to control a TPLink HS110 or HS100 smart plug. | |
# Usage: $0 -u username -p password -d "?" => list devices, and should output token. | |
# Usage: $0 -t <token> -d <device_id> -o off => turn off.. | |
# Usage: $0 -t <token> -d <device_id> -o off => turn on.. | |
# Default action is to turn the first device found off. |